| java.lang.Object fr.ign.cogit.geoxygene.datatools.ojb.GeOxygeneBrokerHelper
GeOxygeneBrokerHelper | public class GeOxygeneBrokerHelper (Code) | | Redefinition de la classe org.apache.ojb.util.BrokerHelper d'OJB,
permettant d'appeler une methode "javaToSql(Object, Connection)
pour ecrire les structures dans Oracle.
Par rapport a la version originale de BrokerHelper :
les imports ont ete reorganises,
le constructeur renomme,
un parametre connection ajoute dans la signature de getValuesForObject (ligne 352),
un ajout dans la methode getValuesForObject (ligne 375),
un parametre connection ajoute dans getAllRwValues,
un parametre connection ajoute dans getNonKeyRwValues,
un parametre connection ajoute dans getKeyValues,
un parametre connection ajoute dans getKeyValues.
Les 4 dernieres modifs se font suite a des erreurs de compile,
suite au premier ajout dans getValuesForObject.
AB 11 juillet 2005 :
Utilisation des noms de classes et de la réflection pour permettre la compilation sépérée pour Oracle.
Patch pour permettre l'utilisation de la meme classe de "FieldConversion" pour Oracle et Postgis.
author: Thierry Badard & Arnaud Braun version: 1.1 |
Method Summary | |
public boolean | assertValidPkFields(FieldDescriptor[] fieldDescriptors, Object[] pkValues) returns true if the primary key fields are valid, else false. | public static String | buildMessageString(Object obj, Object value, Field field) | public static PBKey | crossCheckPBKey(PBKey key) Check if the user of the given PBKey was null , if so we try to
get user/password from the jdbc-connection-descriptor matching the given
PBKey.getAlias(). | public static PBKey | extractAllTokens(String name) splits up the name string and extract db url,
user name and password and build a new PBKey
instance - the token '#' is used to separate
the substrings. | public Object[] | extractValueArray(ValueContainer[] containers) Extract a value array of the given
ValueContainer array. | public ValueContainer[] | getAllRwValues(ClassDescriptor cld, Object obj, Connection conn) | protected Object | getAutoIncrementValue(FieldDescriptor fd, Object obj, Object cv) Get an autoincremented value that has already
had a field conversion run on it.
The data type of the value that is returned by this method is
compatible with the java-world. | public Query | getCountQuery(Query aQuery) | public ValueContainer[] | getKeyValues(ClassDescriptor cld, Object objectOrProxy, boolean convertToSql, Connection conn) returns an Array with an Objects PK VALUES if convertToSql is true, any
associated java-to-sql conversions are applied. | public ValueContainer[] | getKeyValues(ClassDescriptor cld, Identity oid) | public ValueContainer[] | getKeyValues(ClassDescriptor cld, Identity oid, boolean convertToSql) | public ValueContainer[] | getKeyValues(ClassDescriptor cld, Object objectOrProxy, Connection conn) returns an Array with an Objects PK VALUES, with any java-to-sql
FieldConversion applied. | public ValueContainer[] | getNonKeyRwValues(ClassDescriptor cld, Object obj, Connection conn) | protected ClassDescriptor | getRealClassDescriptor(ClassDescriptor aCld, Object anObj) Answer the real ClassDescriptor for anObj
ie. | public ValueContainer[] | getValuesForObject(FieldDescriptor[] fields, Object obj, boolean convertToSql, Connection conn) |
REPOSITORY_NAME_SEPARATOR | final public static String REPOSITORY_NAME_SEPARATOR(Code) | | |
GeOxygeneBrokerHelper | public GeOxygeneBrokerHelper(PersistenceBroker broker)(Code) | | |
assertValidPkFields | public boolean assertValidPkFields(FieldDescriptor[] fieldDescriptors, Object[] pkValues)(Code) | | returns true if the primary key fields are valid, else false.
PK fields are valid if each of them is either an OJB managed
attribute (autoincrement or locking) or if it contains
a valid non-null value
Parameters: fieldDescriptors - the array of PK fielddescriptors Parameters: pkValues - the array of PK values boolean |
crossCheckPBKey | public static PBKey crossCheckPBKey(PBKey key)(Code) | | Check if the user of the given PBKey was null , if so we try to
get user/password from the jdbc-connection-descriptor matching the given
PBKey.getAlias().
|
extractAllTokens | public static PBKey extractAllTokens(String name)(Code) | | splits up the name string and extract db url,
user name and password and build a new PBKey
instance - the token '#' is used to separate
the substrings.
throws: PersistenceBrokerException - if given name was null |
extractValueArray | public Object[] extractValueArray(ValueContainer[] containers)(Code) | | Extract a value array of the given
ValueContainer array.
Parameters: containers - a value array |
getAllRwValues | public ValueContainer[] getAllRwValues(ClassDescriptor cld, Object obj, Connection conn) throws PersistenceBrokerException(Code) | | returns an array containing values for all the Objects attribute (READ/WRITE only)
throws: MetadataException - if there is an erros accessing obj field values |
getAutoIncrementValue | protected Object getAutoIncrementValue(FieldDescriptor fd, Object obj, Object cv)(Code) | | Get an autoincremented value that has already
had a field conversion run on it.
The data type of the value that is returned by this method is
compatible with the java-world. The return value has NOT
been run through a field conversion and converted to a corresponding
sql-type.
throws: MetadataException - if there is an erros accessing obj field values |
getCountQuery | public Query getCountQuery(Query aQuery)(Code) | | Build a Count-Query based on aQuery
Parameters: aQuery - a Query |
getKeyValues | public ValueContainer[] getKeyValues(ClassDescriptor cld, Object objectOrProxy, boolean convertToSql, Connection conn) throws PersistenceBrokerException(Code) | | returns an Array with an Objects PK VALUES if convertToSql is true, any
associated java-to-sql conversions are applied. If the Object is a Proxy
or a VirtualProxy NO conversion is necessary.
Parameters: objectOrProxy - Parameters: convertToSql - Object[] throws: PersistenceBrokerException - |
getKeyValues | public ValueContainer[] getKeyValues(ClassDescriptor cld, Identity oid) throws PersistenceBrokerException(Code) | | Return key Values of an Identity
Parameters: cld - Parameters: oid - Object[] throws: PersistenceBrokerException - |
getKeyValues | public ValueContainer[] getKeyValues(ClassDescriptor cld, Identity oid, boolean convertToSql) throws PersistenceBrokerException(Code) | | Return key Values of an Identity
Parameters: cld - Parameters: oid - Parameters: convertToSql - Object[] throws: PersistenceBrokerException - |
getKeyValues | public ValueContainer[] getKeyValues(ClassDescriptor cld, Object objectOrProxy, Connection conn) throws PersistenceBrokerException(Code) | | returns an Array with an Objects PK VALUES, with any java-to-sql
FieldConversion applied. If the Object is a Proxy or a VirtualProxy NO
conversion is necessary.
Parameters: objectOrProxy - Object[] throws: PersistenceBrokerException - |
getNonKeyRwValues | public ValueContainer[] getNonKeyRwValues(ClassDescriptor cld, Object obj, Connection conn) throws PersistenceBrokerException(Code) | | returns an Array with an Objects NON-PK VALUES (READ/WRITE only)
throws: MetadataException - if there is an erros accessing o field values |
getRealClassDescriptor | protected ClassDescriptor getRealClassDescriptor(ClassDescriptor aCld, Object anObj)(Code) | | Answer the real ClassDescriptor for anObj
ie. aCld may be an Interface of anObj, so the cld for anObj is returned
|
getValuesForObject | public ValueContainer[] getValuesForObject(FieldDescriptor[] fields, Object obj, boolean convertToSql, Connection conn) throws PersistenceBrokerException(Code) | | Get the values of the fields for an obj
Parameters: fields - Parameters: obj - throws: PersistenceBrokerException - |
|
|