Class LcEntityTypeInfo
- java.lang.Object
-
- net.lecousin.reactive.data.relational.model.LcEntityTypeInfo
-
public class LcEntityTypeInfo extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLcEntityTypeInfo.ForeignTableInfostatic classLcEntityTypeInfo.JoinTableInfo
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Collection<Class<?>>addGeneratedJoinTables(Collection<Class<?>> classes)static LcEntityTypeInfoget(Class<?> clazz)static Collection<Class<?>>getClasses()FieldgetForeignTableFieldForJoinKey(String joinKey, Class<?> targetType)Return the foreign table field having the given join key.FieldgetForeignTableFieldForProperty(String propertyName)Return the foreign table field on the given property.ForeignTablegetForeignTableForProperty(String propertyName)Return the foreign table field on the given property.Collection<LcEntityTypeInfo.ForeignTableInfo>getForeignTables()Return the list of foreign tables.LcEntityTypeInfo.ForeignTableInfogetForeignTableWithFieldForJoinKey(String joinKey, Class<?> targetType)Return the foreign table field having the given join key.LcEntityTypeInfo.JoinTableInfogetJoinTable(String propertyName)Return join table information on the given property name.<T> Collection<T>getJoinTableElementsForJoinTableClass(Object instance, Class<T> joinTableClass)Collection<LcEntityTypeInfo.JoinTableInfo>getJoinTables()Return the list of join tables on this type.FieldgetRequiredForeignTableFieldForJoinKey(String joinKey, Class<?> targetType)Return the foreign table field having the given join key.FieldgetRequiredForeignTableFieldForProperty(String propertyName)Return the foreign table field on the given property.ForeignTablegetRequiredForeignTableForProperty(String propertyName)Return the foreign table field on the given property.LcEntityTypeInfo.ForeignTableInfogetRequiredForeignTableWithFieldForJoinKey(String joinKey, Class<?> targetType)Return the foreign table field having the given join key.FieldgetStateField()static booleanisForeignTableField(Field field)Return true if the given field is associated to a @ForeignTable annotation.static voidsetClasses(Collection<Class<?>> classes)
-
-
-
Method Detail
-
setClasses
public static void setClasses(Collection<Class<?>> classes) throws ModelException
- Throws:
ModelException
-
get
public static LcEntityTypeInfo get(Class<?> clazz)
-
getClasses
public static Collection<Class<?>> getClasses()
-
addGeneratedJoinTables
public static Collection<Class<?>> addGeneratedJoinTables(Collection<Class<?>> classes)
-
getStateField
public Field getStateField()
-
getForeignTableFieldForJoinKey
@Nullable public Field getForeignTableFieldForJoinKey(String joinKey, Class<?> targetType)
Return the foreign table field having the given join key.- Parameters:
joinKey- join keytargetType- type of target entity- Returns:
- the field
-
getRequiredForeignTableFieldForJoinKey
public Field getRequiredForeignTableFieldForJoinKey(String joinKey, Class<?> targetType)
Return the foreign table field having the given join key.- Parameters:
joinKey- join keytargetType- type of target entity- Returns:
- the field
-
getForeignTableWithFieldForJoinKey
@Nullable public LcEntityTypeInfo.ForeignTableInfo getForeignTableWithFieldForJoinKey(String joinKey, Class<?> targetType)
Return the foreign table field having the given join key.- Parameters:
joinKey- join keytargetType- type of target entity- Returns:
- the field and the foreign table annotation
-
getRequiredForeignTableWithFieldForJoinKey
public LcEntityTypeInfo.ForeignTableInfo getRequiredForeignTableWithFieldForJoinKey(String joinKey, Class<?> targetType)
Return the foreign table field having the given join key.- Parameters:
joinKey- join keytargetType- type of target entity- Returns:
- the field and the foreign table annotation
-
getForeignTableFieldForProperty
@Nullable public Field getForeignTableFieldForProperty(String propertyName)
Return the foreign table field on the given property.- Parameters:
propertyName- foreign table property- Returns:
- the field
-
getRequiredForeignTableFieldForProperty
public Field getRequiredForeignTableFieldForProperty(String propertyName)
Return the foreign table field on the given property.- Parameters:
propertyName- foreign table property- Returns:
- the field
-
getForeignTableForProperty
@Nullable public ForeignTable getForeignTableForProperty(String propertyName)
Return the foreign table field on the given property.- Parameters:
propertyName- foreign table property- Returns:
- the foreign table annotation
-
getRequiredForeignTableForProperty
public ForeignTable getRequiredForeignTableForProperty(String propertyName)
Return the foreign table field on the given property.- Parameters:
propertyName- foreign table property- Returns:
- the foreign table annotation
-
isForeignTableField
public static boolean isForeignTableField(Field field)
Return true if the given field is associated to a @ForeignTable annotation.- Parameters:
field- field- Returns:
- true if it is a foreign table
-
getForeignTables
public Collection<LcEntityTypeInfo.ForeignTableInfo> getForeignTables()
Return the list of foreign tables.- Returns:
- list of fields with their corresponding foreign table annotation
-
getJoinTable
@Nullable public LcEntityTypeInfo.JoinTableInfo getJoinTable(String propertyName)
Return join table information on the given property name.- Parameters:
propertyName- property- Returns:
- join table info
-
getJoinTables
public Collection<LcEntityTypeInfo.JoinTableInfo> getJoinTables()
Return the list of join tables on this type.- Returns:
- join tables
-
getJoinTableElementsForJoinTableClass
public <T> Collection<T> getJoinTableElementsForJoinTableClass(Object instance, Class<T> joinTableClass)
-
-