ManyToOne « Load « JPA Q&A

1. Hibernate JPA - ManyToOne relationship not populated

I'm currently moving a (working) app from using EclipseLink to Hibernate JPA, mostly it's gone quite smoothly, but I'm finding one thing that I can't explain, and also can't think of ...

2. Can I cache a ManyToOne hibernate object without it being lazy loaded?

@JoinColumn(name = "play_template_id", table = "team_play_mapping" )
public Play getPlay() {
    return play;

public void setPlay( Play play ) { = play;
By default, this is eager ...

3. Hibernate JPA: How to controll "Not-Found" behavior when lazy loading a ManyToOne relation?

In older xml based hibernate, one can have this config , <many-to-one ... not-found="ignore" /> but in JAP annnotions, there seems to be nothing similar. My problem is that our company has SQL REFERENCE ...

5. ClassCastException when using @ManyToOne with lazy loading

I have the following minimal example of entities that show my problem: Code: @Entity @Inheritance(strategy = InheritanceType.JOINED) public class AbstractProduct { @Id @GeneratedValue private Long id; } @Entity public class Product extends AbstractProduct { //... } @Entity public class ProductOrder { @Id @GeneratedValue ...

6. Hibernate JPA Lazy Loading on ManyToOne not working

Can you please show how your schema is created? In particular it's is interesting me where parent_id field is mapped. If it is mapped in the source class (you don't specify the name of your source entity) or if it is mapped in the target class (target entity) DocumentCategoryModel. (In ladder case Lazy cannot not work).

7. HQL query : All ManyToOne are eagerly loaded

I have some Business Objects that have ManyToOne associations with default fetch type for Hibernate 3 (LAZY). If I load one of those objects using session.get(..) I get a cglib proxy as expected and thus my ManyToOne's are not loaded until I access them. The problem is if I load one of those objects using HQL, I get the concrete class, ...

8. Why ManyToOne optional association can LAZY-load?

Hi guys. I have been browsing this forum, the HB documentation and the HB in action book for a while now and I cannot figure out why ManyToOne optional associations can LAZY-load and OneToOne optional associations cannot. Yes, I know, I have been visiting the HB wiki as well: Proxying an optional OneToOne association does not make sense since we need ...

9. ManyToOne and lazy loading (again?)