Static « Entity « JPA Q&A

1. Hibernate (JPA) Entity with Static collection as a member

Is it possible to have a static collection as a member of a hibernate entity? Say I have an object Question:

public class Question {
    private String category;


2. JPA Best Practice: Static Lookup Entities

Imagine, an Event entity references a Status Entity:

@Table(name = "event")
public class Event()
  @Column(name = "id", nullable = false)
  private long id;

  @JoinColumn(name ...

3. static domain entities

/** * base entity with common properties */ public class DomainEntityBase { private long id; private String name; public DomainEntityBase() {} public DomainEntityBase(long id, String name) { this.setId(id) this.setName(name); } // etc. }