Traverse « Relationship « JPA Q&A





1. Traversing ORM relationships returns duplicate results    stackoverflow.com

I have 4 tables -- store, catalog_galleries, catalog_images, and catalog_financials. When I traverse the relationship from store --> catalog_galleries --> catalog_images in other words: store.getCatalogGallery().getCatalogImages() I get duplicate records. Does anyone ...

2. Traversing ORM relationships returns duplicate results    forum.hibernate.org

@Entity @Table(name="store") public class Store { ... private CatalogGallery gallery; ... @OneToOne(mappedBy="store") public CatalogGallery getGallery() { return gallery; } }

3. Traversing results returned in many-to-one relationship    forum.hibernate.org

Hi all, I'm doing a simple query joining 2 tables with a many-to-one relationship. The query is "from Employee e join e.dept d where d.dept_id=?". I'm using Spring dao HibernateDaoSupport to get the results and the results are returned in a List. I've become a bit clueless how to traverse this list. The structure of the list looks like this. List ...

4. Traversing Multiple Relationships doesnt work with hibernate    forum.hibernate.org

org.hibernate.hql.ast.QuerySyntaxException: unexpected token: u near line 1, column 111 [SELECT DISTINCT g FROM com.cinerent.starticketmediacenter.server.model.impl.Group g, IN(g.usersSubscribed) AS u WHERE u.username = :username] at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31) at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24) at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59) at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:258) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111) ...