Subset « Map « JPA Q&A





1. JPA / Hibernate Select Column Subset on Join    stackoverflow.com

In SQL it is easy to do a join and only return the columns you want from the joined table. What is the best way to map this in JPA / ...

2. mapping an entity table to subset tables of the entity    forum.hibernate.org

Hibernate version: 2.1 Name and version of the database you are using: MySQL 4.0.16 I have an entity object, a Word with primary key "word_id", and a number of "list" tables, such as "hot_list" or "user_list" which are tables that contain a subset of word_id's. I've created a "UserList" POJO so I can get a Collection of all the Words reference ...

3. Mapping table and need a subset of rows returned    forum.hibernate.org

You should use either HQL with that query, or return a new java collection backed by the existing collection (the one returned by getOrders). The first option is good if you expect the results to change frequently, especially if some other app is setting orders to complete. Using a new collection backed by the existing one avoids having to go back ...

4. Map a collection with a subset of the matched rows    forum.hibernate.org

I have a data model (simplified) that has customer to site (one to many). The sites have a start-date and stop-date field, and in the collection of sites retrieved from customer, I'd like to limit the sites to those that are "current", or current to an arbitrary date, like: Code: select customer.customer_id, site.site_id from customer, site where site.customer_id = customer.customer_id and ...