Class GenericQueryManagerRelationalUtils
java.lang.Object
rife.database.querymanagers.generic.GenericQueryManagerRelationalUtils
Utility class to provide many-to-many and many-to-one relational
capabilities to generic query manager implementations.
- Since:
- 1.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ManyToOneDeclaration
createManyToOneDeclaration
(GenericQueryManager manager, ConstrainedProperty property, Class propertyType) static void
ensureSupportedManyToManyPropertyCollectionType
(Class beanClass, String propertyName, Class propertyType) static void
ensureSupportedManyToManyPropertyValueType
(Class beanClass, String propertyName, Object propertyValue) static void
ensureSupportedManyToOneAssociationPropertyCollectionType
(Class beanClass, String propertyName, Class propertyType) static void
ensureSupportedManyToOneAssociationPropertyValueType
(Class beanClass, String propertyName, Object propertyValue) static String
static String
generateManyToManyJoinTableName
(ManyToManyDeclaration association, GenericQueryManager manager1, GenericQueryManager manager2) static String
generateManyToOneJoinColumnName
(String mainPropertyName, ManyToOneDeclaration declaration) static Map<String,
ManyToManyDeclaration> obtainManyToManyDeclarations
(GenericQueryManager manager, Constrained constrained, boolean includeAssociations) static Map<String,
ManyToOneAssociationDeclaration> obtainManyToOneAssociationDeclarations
(GenericQueryManager manager, Constrained constrained) static Map<String,
ManyToOneDeclaration> obtainManyToOneDeclarations
(GenericQueryManager manager, Constrained constrained, String fixedMainProperty, Class fixedAssocationType) static void
processManyToOneJoinColumns
(GenericQueryManager manager, ManyToOneJoinColumnProcessor processor) static Object
restoreLazyManyToOneProperty
(GenericQueryManager manager, Constrained constrained, String propertyName, String propertyTypeClassName) Restores a constrained many-to-one property value that is lazily loaded.static Object
restoreManyToOneProperty
(GenericQueryManager manager, Object constrained, GenericQueryManager associationManager, String columnName, Class propertyType)
-
Constructor Details
-
GenericQueryManagerRelationalUtils
public GenericQueryManagerRelationalUtils()
-
-
Method Details
-
restoreLazyManyToOneProperty
public static Object restoreLazyManyToOneProperty(GenericQueryManager manager, Constrained constrained, String propertyName, String propertyTypeClassName) Restores a constrained many-to-one property value that is lazily loaded.- Parameters:
manager
- theGenericQueryManager
that will be used to restore the related bean instanceconstrained
- the constrained bean instance that contains the property whose value will be restoredpropertyName
- the name of the property value that will be restoredpropertyTypeClassName
- the class name of the property that will be restored- Returns:
- the value of the property, or
null
if the constrained property doesn't exist or if it didn't have themanyToOne
constraint - Since:
- 1.0
-
restoreManyToOneProperty
public static Object restoreManyToOneProperty(GenericQueryManager manager, Object constrained, GenericQueryManager associationManager, String columnName, Class propertyType) -
createManyToOneDeclaration
public static ManyToOneDeclaration createManyToOneDeclaration(GenericQueryManager manager, ConstrainedProperty property, Class propertyType) throws IncompatibleManyToOneValueTypeException -
obtainManyToOneDeclarations
public static Map<String,ManyToOneDeclaration> obtainManyToOneDeclarations(GenericQueryManager manager, Constrained constrained, String fixedMainProperty, Class fixedAssocationType) -
obtainManyToManyDeclarations
public static Map<String,ManyToManyDeclaration> obtainManyToManyDeclarations(GenericQueryManager manager, Constrained constrained, boolean includeAssociations) -
obtainManyToOneAssociationDeclarations
public static Map<String,ManyToOneAssociationDeclaration> obtainManyToOneAssociationDeclarations(GenericQueryManager manager, Constrained constrained) -
generateManyToManyJoinTableName
public static String generateManyToManyJoinTableName(ManyToManyDeclaration association, GenericQueryManager manager1, GenericQueryManager manager2) -
generateManyToManyJoinColumnName
-
generateManyToOneJoinColumnName
public static String generateManyToOneJoinColumnName(String mainPropertyName, ManyToOneDeclaration declaration) -
processManyToOneJoinColumns
public static void processManyToOneJoinColumns(GenericQueryManager manager, ManyToOneJoinColumnProcessor processor) -
ensureSupportedManyToManyPropertyCollectionType
public static void ensureSupportedManyToManyPropertyCollectionType(Class beanClass, String propertyName, Class propertyType) throws UnsupportedManyToManyPropertyTypeException -
ensureSupportedManyToManyPropertyValueType
public static void ensureSupportedManyToManyPropertyValueType(Class beanClass, String propertyName, Object propertyValue) throws UnsupportedManyToManyPropertyTypeException -
ensureSupportedManyToOneAssociationPropertyCollectionType
public static void ensureSupportedManyToOneAssociationPropertyCollectionType(Class beanClass, String propertyName, Class propertyType) throws UnsupportedManyToManyPropertyTypeException -
ensureSupportedManyToOneAssociationPropertyValueType
public static void ensureSupportedManyToOneAssociationPropertyValueType(Class beanClass, String propertyName, Object propertyValue) throws UnsupportedManyToManyPropertyTypeException
-