Die detaillierte Aufgabenstellung beschreibt die notwendigen Schritte zur Realisierung.
see OneToOne Annotation javadoc
@OneToOne
private Bla bla;
see OneToMany Annotation javadoc
@OneToMany
private Collection<Bla> blas;
see ManyToOne Annotation javadoc
@ManyToOne
private Bla bla;
see ManyToMany Annotation javadoc
@ManyToMany
private Collection<Bla> blas;
see UniqueConstraint Annotation javadoc
@Table(uniqueConstraints = @UniqueConstraint(columnNames = {"start_id", "ende_id"}))
class ...
Im Java-Sourcecode
@Transient
private Zahlung zahlung;
oder
private transient Zahlung zahlung;
Im mapping xml
<transient name="zahlung"/>
als Referenz Inheritance Annotation und InheritanceType Enum javadoc
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
class ...
als Referenz Enumerated Annotation und EnumType Enum javadoc oder dieses Guide auf baeldung
enum Bla {
FOO,
BAR
}
@Entity
class Xyz {
...
@Enumerated(EnumType.ORDINAL)
private Bla bla;
...
}
- https://docs.oracle.com/javaee/7/api/javax/persistence/OneToOne.html
- https://docs.oracle.com/javaee/7/api/javax/persistence/OneToMany.html
- https://docs.oracle.com/javaee/7/api/javax/persistence/ManyToOne.html
- https://docs.oracle.com/javaee/7/api/javax/persistence/ManyToMany.html
- https://docs.oracle.com/javaee/7/api/javax/persistence/UniqueConstraint.html
- https://docs.oracle.com/javaee/7/api/javax/persistence/Inheritance.html
- https://docs.oracle.com/javaee/7/api/javax/persistence/InheritanceType.html
- https://docs.oracle.com/javaee/7/api/javax/persistence/Enumerated.html
- https://docs.oracle.com/javaee/7/api/javax/persistence/EnumType.html
- https://www.baeldung.com/jpa-persisting-enums-in-jpa