com.uwyn.rife.database.querymanagers.generic
Class GenericQueryManagerRelationalUtils

java.lang.Object
  extended by com.uwyn.rife.database.querymanagers.generic.GenericQueryManagerRelationalUtils

public abstract class GenericQueryManagerRelationalUtils
extends Object

Utility class to provide many-to-many and many-to-one relational capabilities to generic query manager implementations.

Since:
1.6
Version:
$Revision: 3760 $
Author:
Geert Bevin (gbevin[remove] at uwyn dot com)

Constructor Summary
GenericQueryManagerRelationalUtils()
           
 
Method Summary
static 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 generateManyToManyJoinColumnName(GenericQueryManager manager)
           
static String generateManyToManyJoinTableName(ManyToManyDeclaration assocation, 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, GenericQueryManager associationManager, String columnName, Class propertyType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericQueryManagerRelationalUtils

public GenericQueryManagerRelationalUtils()
Method Detail

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 - the GenericQueryManager that will be used to restore the related bean instance
constrained - the constrained bean instance that contains the property whose value will be restored
propertyName - the name of the property value that will be restored
propertyTypeClassName - the class name of the property that will be restored
Returns:
the value of the property, or

null if the constrained property doesn't exists or if it didn't have the manyToOne constraint

Since:
1.6

restoreManyToOneProperty

public static Object restoreManyToOneProperty(GenericQueryManager manager,
                                              GenericQueryManager associationManager,
                                              String columnName,
                                              Class propertyType)

createManyToOneDeclaration

public static ManyToOneDeclaration createManyToOneDeclaration(GenericQueryManager manager,
                                                              ConstrainedProperty property,
                                                              Class propertyType)
                                                       throws IncompatibleManyToOneValueTypeException
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 assocation,
                                                     GenericQueryManager manager1,
                                                     GenericQueryManager manager2)

generateManyToManyJoinColumnName

public static String generateManyToManyJoinColumnName(GenericQueryManager manager)

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
Throws:
UnsupportedManyToManyPropertyTypeException

ensureSupportedManyToManyPropertyValueType

public static void ensureSupportedManyToManyPropertyValueType(Class beanClass,
                                                              String propertyName,
                                                              Object propertyValue)
                                                       throws UnsupportedManyToManyPropertyTypeException
Throws:
UnsupportedManyToManyPropertyTypeException

ensureSupportedManyToOneAssociationPropertyCollectionType

public static void ensureSupportedManyToOneAssociationPropertyCollectionType(Class beanClass,
                                                                             String propertyName,
                                                                             Class propertyType)
                                                                      throws UnsupportedManyToManyPropertyTypeException
Throws:
UnsupportedManyToManyPropertyTypeException

ensureSupportedManyToOneAssociationPropertyValueType

public static void ensureSupportedManyToOneAssociationPropertyValueType(Class beanClass,
                                                                        String propertyName,
                                                                        Object propertyValue)
                                                                 throws UnsupportedManyToManyPropertyTypeException
Throws:
UnsupportedManyToManyPropertyTypeException


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.