Hi everyone,
I am having trouble querying a one to many foreign key relationship. For example one product can have many parts. I would like to retrieve the part name, part number etc relating to a product id. The Product table stores a Set of Parts and the Part table stores the Product object.
Code:
Error:
18:44:50,801 INFO TransactionFactoryFactory:34 - Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
Exception in thread "main" org.hibernate.hql.ast.QuerySyntaxException: unexpected AST node: ( near line 1, column 101 [from hibernate.Product p, hibernate.Part a where a.getProduct().getId()=p.id]
If you can help please post a response I have tried many different variations including inner join etc.
Thanks
Alyssa
I am having trouble querying a one to many foreign key relationship. For example one product can have many parts. I would like to retrieve the part name, part number etc relating to a product id. The Product table stores a Set of Parts and the Part table stores the Product object.
Code:
Error:
18:44:50,801 INFO TransactionFactoryFactory:34 - Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
Exception in thread "main" org.hibernate.hql.ast.QuerySyntaxException: unexpected AST node: ( near line 1, column 101 [from hibernate.Product p, hibernate.Part a where a.getProduct().getId()=p.id]
If you can help please post a response I have tried many different variations including inner join etc.
Thanks
Alyssa