Persist « Fetch « JPA Q&A





1. Hibernate: Retrieve rows that are not joined    stackoverflow.com

I have two tables joined together with entities like this (entities anonymized, and trimmed of irrelevant properties): Email - Email_ID - Title - Body (hibernate uses a Body_ID field here) Body - Body_ID ...

2. persisting a new object without having to fetch the associations    stackoverflow.com

I have the following mapping in an Ad entity:

class Ad ... {
@Id
    @Column(name = "id", unique = true, nullable = false)   
    @GeneratedValue(strategy ...

3. Hibernate/JPA: Is it possible to retrieve heterogeneous entities in a single query?    stackoverflow.com

I have 2 entities: EntityA and EntityB. They are unrelated, and I cannot put them in a Inheritance tree for some restrictions out of the scope of this question. But I need to ...

4. Configuring hibernate to retrieve a collection without persisting it    stackoverflow.com

Database: I have a three-way join table called Users_Accounts_Roles.

+--------------+------------+------+-----+-------------------+----------------+
| Field        | Type       | Null | Key | Default  ...

5. How do you retrieve an auto increment key after persisting t    forum.hibernate.org

Hi ALL, I'm using jpa,hibernate on mysql. here Im facing one problem. My tables are keyed with auto_increment primary keys. I need to persist one course object and n branch objects. Code follows .. Code: entityManager.persist(course); for (Branch branch : branchs) { if(branch.getTitle()!=null&&!"".equals(branch.getTitle())) ...

6. Newbie: need help with fetching a persisted object    forum.hibernate.org

I'm very new to Hibernate. I have a Persons table. Persons : civilID (char) name (char) surname (char) ... what I basically want is to select a Person and store it in HttpSession scope. so I wrote this code : Code: StringBuffer sb = new StringBuffer(); sb.append(" select"); ...