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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ManyToOneDeclarationcreateManyToOneDeclaration(GenericQueryManager manager, ConstrainedProperty property, Class propertyType) static voidensureSupportedManyToManyPropertyCollectionType(Class beanClass, String propertyName, Class propertyType) static voidensureSupportedManyToManyPropertyValueType(Class beanClass, String propertyName, Object propertyValue) static voidensureSupportedManyToOneAssociationPropertyCollectionType(Class beanClass, String propertyName, Class propertyType) static voidensureSupportedManyToOneAssociationPropertyValueType(Class beanClass, String propertyName, Object propertyValue) static Stringstatic StringgenerateManyToManyJoinTableName(ManyToManyDeclaration association, GenericQueryManager manager1, GenericQueryManager manager2) static StringgenerateManyToOneJoinColumnName(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 voidprocessManyToOneJoinColumns(GenericQueryManager manager, ManyToOneJoinColumnProcessor processor) static ObjectrestoreLazyManyToOneProperty(GenericQueryManager manager, Constrained constrained, String propertyName, String propertyTypeClassName) Restores a constrained many-to-one property value that is lazily loaded.static ObjectrestoreManyToOneProperty(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- theGenericQueryManagerthat 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
nullif the constrained property doesn't exist or if it didn't have themanyToOneconstraint - 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
-