org.julp.db
Class DomainObjectFactory<T>

java.lang.Object
  extended by org.julp.AbstractDomainObjectFactory<T>
      extended by org.julp.db.DomainObjectFactory<T>
All Implemented Interfaces:
java.io.Serializable

public class DomainObjectFactory<T>
extends AbstractDomainObjectFactory<T>

See Also:
Serialized Form

Field Summary
protected  java.lang.String catalog
          Target DB catalog
protected  Converter converter
          Get value from ResultSet as specified datatype
protected  DBServices dbServices
          This is JDBC utility
protected  boolean generateSQLOnly
          Do not execute INSERTS/UPDATES/DELETES - just generate SQL and parameters
protected  boolean noFullColumnName
          Some databases (like hsqldb) fail when UPDATE/INSERT statements are using TABLE_NAME.COLUMN_NAME in SET clause.
protected  boolean overrideCatalogName
          If overrideCatalogName == true and catalog from this.metaData is null than use catalog member variable
protected  java.lang.String schema
          Target DB schema
private static long serialVersionUID
           
protected  java.lang.String table
          Target DB Table
protected  boolean throwFailedInsertException
           
protected  boolean throwOptimisticLockDeleteException
          Throw exception if PreparedStatement.executeUpdate() does not return 1 for each DomainObject.
protected  boolean throwOptimisticLockUpdateException
           
 
Fields inherited from class org.julp.AbstractDomainObjectFactory
addEnhancedObjectToObjectList, append, createDefaultMetaData, dataReader, dataWriter, discardUnmodifiedObjects, domainClass, domainFactoryId, EMPTY_READ_ARG, exceptionOnEmptyObjectList, instantiator, lazyLoading, listeners, mapping, metaData, objectId, objectList, options, readOnly, removedObjects, throwMissingFieldException, valid
 
Constructor Summary
DomainObjectFactory()
           
 
Method Summary
 DataReader getDataReader()
          Getter for property dataReader.
 DataWriter getDataWriter()
          Getter for property dataWriter.
 DBServices getDBServices()
           
 void loadMappings(java.lang.String resource)
           
 java.util.Properties loadProperties(java.lang.String resource)
           
 void setDBServices(DBServices dbServices)
           
 boolean writeData()
          Implement and call this method to persist data
 
Methods inherited from class org.julp.AbstractDomainObjectFactory
addObject, addObject, addPropertyChangeListeners, afterCreate, afterRemove, afterStore, afterWriteData, beforeCreate, beforeRemove, beforeStore, beforeWriteData, clearData, create, createOriginalValues, discard, enhance, filter, findIdxByObjectId, findObjectByObjectId, getCreatedCount, getDomainClass, getMapping, getMetaData, getModifiedCount, getNextObjectId, getObjectList, getObjects, getOptions, getPersistenceError, getRemovedCount, getRemovedObjects, isAddEnhancedObjectToObjectList, isAppend, isCreateDefaultMetaData, isDiscardUnmodifiedObjects, isExceptionOnEmptyObjectList, isLazyLoading, isReadOnly, isThrowMissingFieldException, isValid, load, load, load, newInstance, populateMetaData, remove, removePropertyChangeListeners, setAddEnhancedObjectToObjectList, setAppend, setCreateDefaultMetaData, setDataReader, setDataWriter, setDiscardUnmodifiedObjects, setDomainClass, setExceptionOnEmptyObjectList, setLazyLoading, setMapping, setMapping, setMetaData, setObject, setObject, setObjectList, setOptions, setOriginal, setReadOnly, setRemovedObjects, setThrowMissingFieldException, setupEnhancedObject, store, synchronizePersistentState, syncOriginal, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

throwOptimisticLockDeleteException

protected boolean throwOptimisticLockDeleteException
Throw exception if PreparedStatement.executeUpdate() does not return 1 for each DomainObject. It means that the row in DB Table most likely was modified or deleted by another user/process. Does not work with Oracle JDBC Driver batch since driver does not return correct values


throwOptimisticLockUpdateException

protected boolean throwOptimisticLockUpdateException

throwFailedInsertException

protected boolean throwFailedInsertException

catalog

protected java.lang.String catalog
Target DB catalog


overrideCatalogName

protected boolean overrideCatalogName
If overrideCatalogName == true and catalog from this.metaData is null than use catalog member variable


schema

protected java.lang.String schema
Target DB schema


table

protected java.lang.String table
Target DB Table


dbServices

protected DBServices dbServices
This is JDBC utility


generateSQLOnly

protected boolean generateSQLOnly
Do not execute INSERTS/UPDATES/DELETES - just generate SQL and parameters


noFullColumnName

protected boolean noFullColumnName
Some databases (like hsqldb) fail when UPDATE/INSERT statements are using TABLE_NAME.COLUMN_NAME in SET clause.


converter

protected Converter converter
Get value from ResultSet as specified datatype

Constructor Detail

DomainObjectFactory

public DomainObjectFactory()
Method Detail

getDBServices

public DBServices getDBServices()

setDBServices

public void setDBServices(DBServices dbServices)

getDataWriter

public DataWriter getDataWriter()
Description copied from class: AbstractDomainObjectFactory
Getter for property dataWriter.

Overrides:
getDataWriter in class AbstractDomainObjectFactory<T>
Returns:
Value of property dataWriter.

getDataReader

public DataReader getDataReader()
Description copied from class: AbstractDomainObjectFactory
Getter for property dataReader.

Overrides:
getDataReader in class AbstractDomainObjectFactory<T>
Returns:
Value of property dataReader.

loadProperties

public java.util.Properties loadProperties(java.lang.String resource)

loadMappings

public void loadMappings(java.lang.String resource)

writeData

public boolean writeData()
Description copied from class: AbstractDomainObjectFactory
Implement and call this method to persist data

Specified by:
writeData in class AbstractDomainObjectFactory<T>