We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the following seems to break:
@Entity @Table("books") public class Book { public: @Id @Generated Uint id; @Column("title", 250) @NotNull string title; @ManyToOne @JoinColumn("author_id") @NotNull Person author; } @Entity @Table("people") public class Person { public: @Id @Generated Uint id; @Column("name", 50) @NotNull string name; }
when I try to get books by user the program bombs out:
Query q = session .createQuery("FROM Book WHERE author=:person") .setParameter("person", somePersonObject); return q.list!Book();
The text was updated successfully, but these errors were encountered:
I thought I had updated this issue. I have got ManyToOne working, just not as expected. It wasn't clear from the documentation that I had to do:
Query q = session .createQuery("FROM Book WHERE author=:personId") .setParameter("personId", somePersonObject.id); return q.list!Book();
Sorry, something went wrong.
Strange. It's not expected to work this way
I added a test for it in hdtest/source/htestmain.d in this commit to ensure it keeps working as-is:
hdtest/source/htestmain.d
writeln("Test retrieving users by group... (ManyToOne relationship)"); auto qUsersByGroup = sess.createQuery("FROM User WHERE group=:group_id").setParameter("group_id", grp2.id); User[] usersByGroup = qUsersByGroup.list!User(); assert(usersByGroup.length == 2);
I think there should be WHERE group.id=:group_id
fix postgresql autocommit issue - buggins#22 buggins#29
b1e5030
buggins
No branches or pull requests
the following seems to break:
when I try to get books by user the program bombs out:
The text was updated successfully, but these errors were encountered: