public final class Relation extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Relation.ForeignKey
The Enum ForeignKey.
|
| Modifier and Type | Field and Description |
|---|---|
private Field |
biDirectionalField |
private List<javax.persistence.CascadeType> |
cascades
The cascades.
|
private javax.persistence.FetchType |
fetchType
The fetch type.
|
private boolean |
isJoinedByPrimaryKey
Whether this relationship is joined by primary key, only applicable for
OneToOne.
|
private boolean |
isRelatedViaJoinTable
Whether this relationship is through a Join Table.
|
private String |
joinColumnName
Join column name for this relationship.
|
private JoinTableMetadata |
joinTableMetadata
Metadata for JoinTable, applicable only if isRelatedViaJoinTable==true.
|
private Class<?> |
mapKeyJoinClass
If relation is through a Map, Map Key Join Class
|
private String |
mappedBy
The mapped by.
|
private boolean |
optional
The optional.
|
private Field |
property
The property.
|
private Class<?> |
propertyType
The property type.
|
private Class<?> |
targetEntity
The target entity.
|
private EntityMetadata |
targetEntityMetadata
Target entity metadata.
|
private Relation.ForeignKey |
type
The type.
|
| Constructor and Description |
|---|
Relation(Field property,
Class<?> targetEntity,
Class<?> propertyType,
javax.persistence.FetchType fetchType,
List<javax.persistence.CascadeType> cascades,
boolean optional,
String mappedBy,
Relation.ForeignKey type)
Specifies the type of the metadata.
|
| Modifier and Type | Method and Description |
|---|---|
Field |
getBiDirectionalField() |
List<javax.persistence.CascadeType> |
getCascades()
Gets the cascades.
|
javax.persistence.FetchType |
getFetchType()
Gets the fetch type.
|
String |
getJoinColumnName(EntityManagerFactoryImpl.KunderaMetadata kunderaMetadata)
Gets the join column name.
|
JoinTableMetadata |
getJoinTableMetadata()
Gets the join table metadata.
|
Class<?> |
getMapKeyJoinClass() |
String |
getMappedBy()
Gets the mapped by.
|
Field |
getProperty()
Gets the property.
|
Class<?> |
getPropertyType()
Gets the property type.
|
Class<?> |
getTargetEntity()
Gets the target entity.
|
Relation.ForeignKey |
getType()
Gets the type.
|
boolean |
isBiDirectional() |
boolean |
isCollection()
Checks if is collection.
|
boolean |
isJoinedByPrimaryKey()
Checks if is joined by primary key.
|
boolean |
isOptional()
Checks if is optional.
|
boolean |
isRelatedViaJoinTable()
Checks if is related via join table.
|
boolean |
isUnary()
Checks if is unary.
|
void |
setBiDirectionalField(Class referencedClass) |
void |
setJoinColumnName(String joinColumnName)
Sets the join column name.
|
void |
setJoinedByPrimaryKey(boolean isJoinedByPrimaryKey)
Sets the joined by primary key.
|
void |
setJoinTableMetadata(JoinTableMetadata joinTableMetadata)
Sets the join table metadata.
|
void |
setMapKeyJoinClass(Class<?> mapKeyJoinClass) |
void |
setRelatedViaJoinTable(boolean isRelatedViaJoinTable)
Sets the related via join table.
|
private Field property
private Class<?> targetEntity
private Class<?> mapKeyJoinClass
private Class<?> propertyType
private javax.persistence.FetchType fetchType
private List<javax.persistence.CascadeType> cascades
private boolean optional
private String mappedBy
private Relation.ForeignKey type
private String joinColumnName
private boolean isRelatedViaJoinTable
private JoinTableMetadata joinTableMetadata
private EntityMetadata targetEntityMetadata
private boolean isJoinedByPrimaryKey
private Field biDirectionalField
public Field getProperty()
public Class<?> getTargetEntity()
public Class<?> getMapKeyJoinClass()
public void setMapKeyJoinClass(Class<?> mapKeyJoinClass)
mapKeyJoinClass - the mapKeyJoinClass to setpublic Class<?> getPropertyType()
public javax.persistence.FetchType getFetchType()
public List<javax.persistence.CascadeType> getCascades()
public boolean isOptional()
public String getMappedBy()
public Relation.ForeignKey getType()
public String getJoinColumnName(EntityManagerFactoryImpl.KunderaMetadata kunderaMetadata)
public void setJoinColumnName(String joinColumnName)
joinColumnName - the joinColumnName to setpublic boolean isRelatedViaJoinTable()
public void setRelatedViaJoinTable(boolean isRelatedViaJoinTable)
isRelatedViaJoinTable - the isRelatedViaJoinTable to setpublic JoinTableMetadata getJoinTableMetadata()
public void setJoinTableMetadata(JoinTableMetadata joinTableMetadata)
joinTableMetadata - the joinTableMetadata to setpublic boolean isJoinedByPrimaryKey()
public void setJoinedByPrimaryKey(boolean isJoinedByPrimaryKey)
isJoinedByPrimaryKey - the isJoinedByPrimaryKey to setpublic boolean isUnary()
public boolean isCollection()
public boolean isBiDirectional()
public Field getBiDirectionalField()
public void setBiDirectionalField(Class referencedClass)
Copyright © 2015. All Rights Reserved.