User Tools

Site Tools


programming:java:jpa

This is an old revision of the document!


Java Persistance API

JPA is an API, provided by Oracle.

Hibernate, EclipseLink etc. are implementations of that API.

Entity

Entity Annotaions

These annotations should be red as following:

  • The first part is applied to the object, which contains the property
  • The second part is applied to propery (which should be an entity)
class wood

@OneToMany
@JoinColumn(name="wood")
Set<Tree> tree
Object wood. Property tree. One wood has many trees. Property has to be a collection
class tree

@ManyToOne
@JoinColumn(name="tree")
Wood wood
Object tree. Property wood. Many trees in wood.
programming/java/jpa.1497448749.txt.gz · Last modified: (external edit)