You are using field access strategy (determined by @Id annotation). Put any JPA related annotation right above each field instead of getter property
@OneToMany(targetEntity=Student.class, mappedBy="college", fetch=FetchType.EAGER)
private List<Student> students;
More Related Contents:
- JPA JoinColumn vs mappedBy
- How to fix the Hibernate “object references an unsaved transient instance – save the transient instance before flushing” error
- Hibernate Annotations – Which is better, field or property access?
- How to map calculated properties with JPA and Hibernate
- How to print a query string with parameter values when using Hibernate
- Bypass GeneratedValue in Hibernate (merge data not in db?)
- When and why JPA entities should implement the Serializable interface?
- How should equals and hashcode be implemented when using JPA and Hibernate
- I found JPA, or alike, don’t encourage DAO pattern
- Hibernate – @ElementCollection – Strange delete/insert behavior
- session.connection() deprecated on Hibernate?
- Hibernate: flush() and commit()
- Automatic reserved word escaping for Hibernate tables and columns
- Location of hibernate.cfg.xml in project?
- What’s the use of session.flush() in Hibernate
- how to configure hibernate config file for sql server
- How to set a default entity property value with Hibernate
- mappedBy reference an unknown target entity property
- Hibernate use of PostgreSQL sequence does not affect sequence table
- Primitive or wrapper for hibernate primary keys
- Enum in Hibernate, persisting as an enum
- Hibernate sequence on oracle, @GeneratedValue(strategy = GenerationType.AUTO)
- How to use Hibernate @Any-related annotations?
- How to turn off hbm2ddl?
- Hibernate triggering constraint violations using orphanRemoval
- HibernateException: Couldn’t obtain transaction-synchronized Session for current thread
- Hibernate vs JPA vs JDO – pros and cons of each? [closed]
- Clarifying terminology – What does “hydrating” a JPA or Hibernate entity mean when fetching the entity from the DB
- Difference between @GeneratedValue and @GenericGenerator
- getting result set into DTO with native SQL Query in Hibernate