Package ejava.examples.orm.rel.annotated
Class Inventory
- java.lang.Object
-
- ejava.examples.orm.rel.annotated.Inventory
-
@Entity public class Inventory extends Object
This class is used as an example of a @OneToMay, using a join table. In this example, the Inventory has a OneToMany relationship with Media. The navigation is uni-directional from Inventory to Media and the MEDIA table has no foreign key to reference the INVENTORY table. An INVENTORY_MEDIA join (or link) table is used to make the linkage.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getId()
Collection<Media>
getMedia()
String
getName()
private String
myInstance()
void
setMedia(Collection<Media> media)
void
setName(String name)
String
toString()
-
-
-
Field Detail
-
id
private long id
-
name
private String name
-
media
private Collection<Media> media
-
-
Method Detail
-
getId
public long getId()
-
getMedia
public Collection<Media> getMedia()
-
setMedia
public void setMedia(Collection<Media> media)
-
getName
public String getName()
-
setName
public void setName(String name)
-
myInstance
private String myInstance()
-
-