Ontimize 5.2072EN

com.ontimize.db
Class TableEntity

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended byjava.rmi.server.UnicastRemoteObject
              extended bycom.ontimize.db.TableEntity
All Implemented Interfaces:
AdvancedEntity, AdvancedQueryEntity, Entity, EntityDataChangeNotifier, FileManagementEntity, IdentifiedEntity, PrivilegedSecurityEntity, java.rmi.Remote, SecureEntity, java.io.Serializable, TransactionalEntity
Direct Known Subclasses:
AdvancedTableEntity, CacheTableEntity, DatabaseMultiConnectionManagerEntity, DefaultTableEntity, PrintTemplateEntity, UserEntity

public abstract class TableEntity
extends java.rmi.server.UnicastRemoteObject
implements AdvancedEntity, SecureEntity, PrivilegedSecurityEntity, FileManagementEntity, EntityDataChangeNotifier, TransactionalEntity, AdvancedQueryEntity, IdentifiedEntity

Abstract class that implements an Entity that represents a database table.

This class provides basic functionalities and configuration parameters for automating database tables mapping.

Author:
Imatia Innovation
See Also:
readProperties(), Entity, Serialized Form

Nested Class Summary
protected  class TableEntity.AttachmentReceiving
          Object of this class are used internally for storing information for current transfers (attachments).
protected  class TableEntity.Receiving
          Object of this class are used internally for storing information for current transfers (attachments).
 
Field Summary
protected  java.util.Properties alias
          Alias properties for this entity, if defined.
protected static AliasPropertiesParser aliasPropertiesParser
           
protected  java.util.Hashtable aliasReverse
          Reverse Alias properties for this entity, if defined.
static char ASTERISK
          The '*' character.
static java.lang.String ATTACHMENT_FILE_DESCRIPTION_COLUMN
          AttachmentFileDescriptionColumn property.
static java.lang.String ATTACHMENT_FILE_NAME_COLUMN
          AttachmentFileNameColumn property.
static java.lang.String ATTACHMENT_FILE_NAME_KEYS
          AttachmentFileNameKeys property.
static java.lang.String ATTACHMENT_FILE_ORIGINAL_NAME_COLUMN
          AttachmentFileOriginalNameColumn property.
static java.lang.String ATTACHMENT_FILE_ORIGINAL_PATH_COLUMN
          AttachmentFileOriginalPathColumn property.
static java.lang.String ATTACHMENT_FILE_PATH
          AttachmentFilePath property.
static java.lang.String ATTACHMENT_FILE_SIZE_COLUMN
          AttachmentFileSizeColumn property.
static java.lang.String ATTACHMENT_SEPARATOR
          Character used for joining the keys while generating names for attachments in this entity.
static java.lang.String ATTACHMENT_TABLE
          AttachmentTable property.
protected  java.lang.String attachmentFileNameColumn
          Column in the database table for storing the attachment filename.
protected  java.util.Vector attachmentFileNameKeys
          Defines which column values are used when generating filenames for attachments, by calling getAttachmentFileNameForKeys() method.
protected  java.lang.String attachmentFilePath
          Path in the file system in which the attached files for this entity will be stored.
protected  java.lang.String attachmentFileSizeColumn
          Defines which column in the table will store the file size.
protected  java.lang.String attachTable
          Table name, used for query StandardAttachmentEntity to classify attachments by 'table name'+'table keys'.
static java.lang.String AUTOCONFIGURATION
          Autoconfiguration property.
static java.lang.String AUTONUMERICAL
          Autonumerical property.
protected  java.lang.String autonumericalColumn
          Column in which numbers provided by Autonumerical object will be inserted in insert operations.
protected static java.util.Calendar calendar
          Calendar object used internally.
static boolean checkOperationResult
           
protected  java.util.Vector columnNames
          List of columns defined by 'Columns' parameter.
static java.lang.String COLUMNS
          Columns property.
protected  int connectionRequestTime
          Time between connection requests.
protected  java.util.Vector dataChangeListeners
          Contains registered DataChangeListeners.
protected  DBLocalErrorMessages dBLocalErrorMessage
          Used for customizing this entity's error messages.
static boolean DEBUG
          Debugging purposes variable.
static boolean DEBUG_DETAILS
          More debugging information.
static boolean DEBUG_TIMES
          Debugging times variable.
static int DEFAULT_MAX_CONNECTION_WAIT_TIME
          Default connection request timeout.
static java.lang.String defaultEntityScriptManagerClassName
           
static java.lang.String DELETE_ACTION
          Key string used for checking action permissions for delete operations.
static java.lang.String DELETE_KEYS
          DeleteKeys property.
protected  java.util.Vector deleteKeys
          List of columns required as Keys-Values to perform delete operations.
protected  java.util.Vector descendantColumnsOrder
          Columns used for specifying 'ORDER BY' SQL clause.
protected  java.lang.String descriptionAttachmentFileColumn
          Column in the database table for storing the attachment user description.
static boolean enableScripting
           
protected static EntitiesPropertiesParser entitiesPropertiesParser
           
protected  java.util.Vector entitiesTableAttribute
          List of entity names for which the TableAttribute information (keys, attributes, ...) will be used when this entity queries another entities.
protected  java.lang.String entityName
          This entity name.
protected  IEntityScriptManager entityScripting
           
static java.lang.String FETCH_SIZE
          FetchSize property.
protected  int fetchSize
          Defines the JDBC statement fetch size.
static java.lang.String FILE_COLUMNS
          FileColumns property.
protected  com.ontimize.db.TableEntity.FileInfoList fileInfoList
          List of FileInfo objects as defined by the 'file_columns' parameter.
static java.lang.String FORCE_DISTINCT
          ForceDistinct property.
protected  boolean forceDistinct
          If true, a DISTINCT keyword will be added to all queries performed by this entity.
static java.lang.String INSERT_ACTION
          Key string used for checking action permissions for insert operations.
static java.lang.String INSERT_AUTOMATICLY_ATTACHMENT
          InsertAutomaticlyAttachment property.
static java.lang.String INSERT_COLUMNS
          InsertColumns property.
static java.lang.String INSERT_KEYS
          InsertKeys property.
protected  boolean insertAttachmentAutomatically
          Defines if attachment records are inserted automatically.
protected  java.util.Vector insertColumn
          List of columns valid insert operations.
protected  java.util.Vector insertKeys
          List of columns required (not null) to perform insert operations.
static char INTERROG
          The '?'
protected  java.util.Vector keys
          List of columns that define the primary key for this entity.
static java.lang.String KEYS
          Keys property.
static java.lang.String LIMIT_QUERY_OTHERS_ENTITIES
          LimitQueryOtherEntities property.
protected  int limitQueryOthersEntities
          Maximum number of results of queries in this entity, for which related entities will be queried.
protected  EntityReferenceLocator locator
          The EntityReferenceLocator for this entity.
static java.lang.String LOG_KEYS
          LogKeys property.
protected  boolean logDelete
          Defines if delete operations will be logged using the default LogWriter, if defined, or log writers specified by 'log_keys'.
protected  boolean logInsert
          Defines if insert operations will be logged using the default LogWriter, if defined, or log writers specified by 'log_keys'.
protected  java.util.Vector logkeys
          String keys for logging in this entity.
protected  boolean logQuery
          Defines if query operations will be logged using the default LogWriter, if defined, or log writers specified by 'log_keys'.
protected  boolean logUpdate
          Defines if update operations will be logged using the default LogWriter, if defined, or log writers specified by 'log_keys'.
static java.lang.String M_ERROR_OPERATION
          Operation error messsage key.
static java.lang.String M_IT_HAS_NOT_CHANGED_ANY_RECORD
          No records changed message key.
static java.lang.String M_LICENSE_PERMISSION_ERROR
          License permission error mesage key.
static java.lang.String M_TEMPORALY_RESTRICTED_BY_PERMISSION_ACTION
          Operation restricted by time constraints message key.
static java.lang.String M_YOU_DO_NOT_HAVE_PERMISSION_TO_EXECUTE_ACTION
          User has not rights to perfom action message key.
protected  DatabaseConnectionManager manager
          The DatabaseConnectionManager object, which provides DatabaseConnections to this entity.
protected  int maxConnectionWaitTime
          Maximum connection request waiting time.
protected  boolean oneToOneMode
          This mode is activated when the Entity models a 1-1 relation (One to One).
protected  java.util.Vector orderColumns
          Columns used for specifying 'ORDER BY' SQL clause.
protected  java.lang.String originalAttachmentFileNameColumn
          Column in the database table for storing the attachment original filename.
protected  java.lang.String originalAttachmentFilePathColumn
          Column in the database table for storing the attachment original file path.
static java.lang.String OTHER_ENTITIES
          OtherEntities property.
protected  java.util.Vector othersEntities
          Entities (by name) that will be queried for data related with records of this entity, when specified in attribute list.
static char PERCENT
          The '%' character.
static java.lang.String PRINCIPAL_COLUMNS
          principal_columns property.
static java.lang.String PRINCIPAL_KEYS
          principal_keys property.
static java.lang.String PRINCIPAL_TABLE
          principal_table property.
protected  java.util.Vector principalColumnNames
          Column list for principal table when one2one mode is enabled.
protected  java.util.Vector principalKeyName
          Columns that make the primary key for this entity's principal table.
protected  java.lang.String principalTable
          principal table when one2one mode is enabled.
protected  int privilegedId
          Privileged Id used for performing operations without checking permissions.
protected  java.util.Properties properties
          Object for storing the properties of this entity.
protected static java.lang.String propertiesPath
          Default path used for looking properties file for this entity.
static java.lang.String QUERY_ACTION
          Key string used for checking action permissions for query operations.
static java.lang.String QUERY_TABLE
          QueryTable property.
protected  java.lang.String queryTable
          The database table/view that this entity queries for data.
protected  java.util.Hashtable receivedAttachmentFile
          Used internally for storing temporal AttachmentReceiving objects for current transfers.
protected  java.util.Hashtable receivedTempFiles
          Used internally.
static boolean RECORD_OPERATIONS
          Specifies if standard operations are recorded by calling OperationRecorder.addOperation().
protected static java.util.Hashtable registeredDispatcher
           
static java.lang.String REPORT_ADVANCED_QUERY_COLUMNS
          ReportAdvancedQueryColumns property.
static java.lang.String REPORT_ADVANCED_QUERY_TYPES
          report_advanced_query_types property.
protected  java.util.Vector reportAvancedQueryColumns
          List of columns for making advanced queries.
protected  java.util.Vector reportAvancedQueryTypes
          List of column types corresponding to columns defined in reportAvancedQueryColumns field.
static java.lang.String SECONDARY_COLUMNS
          secondary_columns property.
static java.lang.String SECONDARY_KEYS
          secondary_keys property.
static java.lang.String SECONDARY_TABLE
          secondary_table property.
protected  java.util.Vector secondaryColumnsNames
          Column list for secondary table when one2one mode is enabled.
protected  java.util.Vector secondaryKeyName
          Columns that make the primary key for this entity's secondary table.
protected  java.lang.String secondaryTable
          secondary table when one2one mode is enabled.
protected  java.util.Hashtable sendAttachmentFile
          Used internally for storing temporal AttachmentReceiving objects for current transfers.
static java.lang.String SORT
          Sort property.
static java.lang.String SORT_DESC
          SortDesc property.
protected  java.lang.String table
          The database table this entity performs operations with.
static java.lang.String TABLE
          Table property.
static java.lang.String TABLE_ATTRIBUTE_ENTITIES
          Deprecated.  
protected  java.util.Hashtable tempFiles
          Used internally.
static int TIME_BETWEEN_DEFAULT_CONNECTION_REQUEST
          Default time between connection requests.
static boolean TRUNCATE_DATE_DEFAULT_VALUE
          Default value for truncate_date parameter.
static java.lang.String TRUNCATE_DATES
          TruncateDates property.
protected  boolean truncateDates
          If true, Date objects will be set to 00:00:00 when calling to setObject method of this class.
static char UNDERSCORE
          The '_' character.
static java.lang.String UPDATE_ACTION
          Key string used for checking action permissions for update operations.
static java.lang.String UPDATE_COLUMNS
          UpdateColumns property.
static java.lang.String UPDATE_KEYS
          UpdateKeys property.
protected  java.util.Vector updateColumn
          List of columns in which update operations are allowed.
protected  java.util.Vector updateKeys
          List of columns required as Keys-Values to perform update operations.
static boolean USE_SETSTRING_LONG_STRINGS
          Sets which method will be used in JDBC prepared statements for setting parameters of type string and length > 255.
static boolean useAlwaysTableAttributeEntities
           
static java.lang.String WILDCARD_COLUMNS
          WildcardColumns property.
protected  java.util.Vector wildcardColumns
          List of columns in which special metacharacters ('%' and '?')
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
TableEntity(EntityReferenceLocator locator, DatabaseConnectionManager dbConnectionManager, int port)
          Constructor for objects of this class.
TableEntity(EntityReferenceLocator locator, DatabaseConnectionManager dbConnectionManager, int port, java.util.Properties prop, java.util.Properties aliasProp)
           
 
Method Summary
 void addEntityDataChangeListener(EntityDataChangeListener listener)
          Registers a EntityDataChangeListener to this entity.
 java.lang.String buildConditionsString(java.util.Hashtable conditions, java.util.Vector values)
          Returns a string containing the conditions to use after the WHERE keyword in the SQL sentence.
 void cancelReceiving(java.lang.String receivingId, int sessionId)
          Cancells the transfer identified by receivingId.
 void checkDeleteKeys(java.util.Hashtable keysValues)
          Checks if keysValues contains a value for all columns defined in 'delete_keys' parameter.
 void checkFinishedSession(int sessionId)
          Checks if the sessionId has an associated session.
 void checkInsertKeys(java.util.Hashtable attributesValues)
          Checks if attributesValues contains a value for all columns defined in 'insert_keys' parameter.
protected  java.util.Vector checkOrderColumns(java.util.Vector order)
           
 void checkPermissions(int sessionId, java.lang.String action)
          Checks if the user/session identified by sessionId has the permission defined by action This method calls ServerManager.getServerSecurityManager() and then, if a manager exists, calls manager.checkActionPermission(int, String, String)
 void checkUpdateKeys(java.util.Hashtable keysValues)
          Checks if keysValues contains a value for all columns defined in 'update_keys' parameter.
protected  void configureReverseAlias()
           
 OntimizeConnection connect()
          Returns an OntimizeConnection by asking the DatabaseConnectionManager.
 OntimizeConnection connect(int userId)
          Returns an OntimizeConnection by asking the DatabaseConnectionManager.
 AdvancedEntityResult createAdvancedEntityResultForSessionId(int cod, int type, int sessionId)
          Utility method for creating an AdvancedEntityResult for the session identified by sessionId .
 AdvancedEntityResult createAdvancedEntityResultForSessionId(int cod, int type, java.lang.String message, int sessionId)
          Utility method for creating an AdvancedEntityResult for the session identified by sessionId .
static EntityResult createEntityResultForSessionId(EntityReferenceLocator locator, int cod, int type, java.lang.String message, int sessionId)
          Utility method for creating an EntityResult for the session identified by sessionId .
 EntityResult createEntityResultForSessionId(int sessionId)
          Utility method for creating an EntityResult for the session identified by sessionId .
 EntityResult createEntityResultForSessionId(int cod, int type, int sessionId)
          Utility method for creating an EntityResult for the session identified by sessionId .
 EntityResult createEntityResultForSessionId(int cod, int type, java.lang.String message, int sessionId)
          Utility method for creating an EntityResult for the session identified by sessionId .
 EntityResult createEntityResultForSessionId(int sessionId, java.lang.String operationId)
          Utility method for creating an EntityResult for the session identified by sessionId .
protected  void createEntityScriptManager()
           
 EntityResult delete(java.util.Hashtable keysValues, int sessionId)
          This method must implement a standard delete operation over the set of records defined by keysValues.
 EntityResult delete(java.util.Hashtable keysValues, int sessionId, java.sql.Connection con)
          Executes a delete operation with the provided Connection.
 boolean deleteAttachmentFile(java.util.Hashtable keysValues, int sessionId)
          This method calls deleteAttachmentFile(Hashtable, int, Connection)
 boolean deleteAttachmentFile(java.util.Hashtable kv, int sessionId, java.sql.Connection con)
          If attachmentFilePath is not null, this method executes a query with conditions keysValues and then if one record is found, searchs the column named attachmentFileNameColumn and uses the file name found to delete the file in the file system.
protected  EntityResult deleteMultipleTableAttributesColumns(EntityResult result, java.util.Vector originalAttributes, java.util.Vector processedMultipleAttributes)
          Processes the EntityResult res creating TableMultipleValue objects .
 void disconnect(OntimizeConnection connection)
          Returns the connection to the DatabaseConnectionManager, by calling unlock(connection) method.
 void disconnect(OntimizeConnection connection, java.lang.String lockKey)
          Returns the connection to the DatabaseConnectionManager, by calling unlock(connection) method.
protected  void dispatcherAttribute(java.lang.Object attribute, EntityResult result, int sessionId)
           
 EntityResult executePreparedStatement(java.lang.String sqlSentence, java.util.Vector values)
          Executes a prepared statement defined by sqlSentence and values.
 EntityResult executePreparedStatement(java.lang.String sqlSentence, java.util.Vector values, java.sql.Connection con, int sessionId)
          Executes the SQL sentence sqlSentence with the parameter list values.
 EntityResult executePreparedStatement(java.lang.String sqlSentence, java.util.Vector values, int sessionId)
          Executes a prepared statement defined by sqlSentence and values.
 EntityResult executePreparedStatement(java.lang.String sqlSentence, java.util.Vector values, int recordNumber, int offset, boolean delimited, int sessionId)
          Executes a prepared statement defined by sqlSentence and values.
 EntityResult executePreparedStatement(java.lang.String sqlSentence, java.util.Vector values, int recordNumber, int offset, boolean delimited, OntimizeConnection con, int sessionId)
          Executes the SQL sentence sqlSentence with the parameter list values.
 EntityResult executePreparedStatement(java.lang.String sqlSentence, java.util.Vector values, OntimizeConnection con)
          Executes a prepared statement defined by sqlSentence and values.
 EntityResult executePreparedStatement(java.lang.String sqlSentence, java.util.Vector values, OntimizeConnection con, int sessionId)
          Executes the SQL sentence sqlSentence with the parameter list values.
protected  EntityResult executeStatement(java.lang.String sqlSentence, java.sql.Connection con)
          Executes the query defined by the SQL sentence sqlSentence using the connection con
 boolean finishReceiving(java.lang.String receivingId, int sessionId)
          Indicates to this entity that the transfer identified by receivingId has finished.
protected  void fireDataChangeEvent(int type, java.util.Hashtable keysValues, java.util.Hashtable attributesValues)
          Deprecated. Use fireDataChangeEvent(int, Hashtable, Hashtable, int)
protected  void fireDataChangeEvent(int type, java.util.Hashtable keysValues, java.util.Hashtable attributesValues, int sessionId)
          Notifies all EntityDataChangeListener objects registered as listeners of this entity, with a new DataChangeEvent with the type, keysValues and attributesValues information.
protected  void fireTransactionDataChangeEvent(int type, java.util.Hashtable kv, java.util.Hashtable av, java.sql.Connection con)
          Deprecated. Use fireTransactionDataChangeEvent(int, Hashtable, Hashtable, int, Connection)
protected  void fireTransactionDataChangeEvent(int type, java.util.Hashtable kv, java.util.Hashtable av, int sessionId, java.sql.Connection con)
          Notifies all TransactionEntityDataChangeListener objects registered as listeners of this entity, with a new DataChangeEvent with the type, keysValues and attributesValues information.
static int generateRandomId()
          Generates a negative random int.
 java.util.Vector getActions()
          Returns the actions that this entity can perform.
 java.lang.String getAliasForColumn(java.lang.String column)
          Returns an alias for the column column if it has been specified.
protected  java.lang.String getAttachmentFileNameForKeys(java.lang.String fileName, java.util.Hashtable keysValues)
          Returns the attachment file name associated to the record identified by keysValues.
protected  java.lang.String getAttachmentFilePath(java.util.Hashtable kv, int sessionId)
           
protected  java.lang.String getAttachmentFilePath(java.util.Hashtable kv, int sessionId, java.sql.Connection con)
           
 java.lang.String getAutonumericalColumn()
          Returns the autonumerical column name or null if nof defined
 BytesBlock getBytes(java.lang.String transferId, int offset, int length, int sessionId)
          Returns a BytesBlock object containing a byte array of length lengthstarting in offset offset for the attachment identified by transferId If offset+length is greater than the file size only file size-offset bytes are returned.
 java.lang.String getColumnForAlias(java.lang.String alias)
          Returns the column for the alias alias if alias have been defined and the alias specified corresponds to a column.
 java.util.Map getColumnListForAvancedQuery(int sessionId)
          Returns a map structure with the columns and sql types of this entity's table.
 java.util.Vector getColumns()
          Returns the list of columns (by name) that may be used in operations in this entity.
 DatabaseConnectionManager getDatabaseConnectionManager()
           
 java.util.Vector getDescOrderColumns()
          Returns the list of columns (by name) to use in ORDER BY DESC clause
 java.lang.String getDescription()
          Returns a description for this entity.
static int getEntityPrivilegedId(Entity ent)
          Gets the privileged identifier for the entity ent.
 Entity getEntityReference(java.lang.String entityName)
          Returns a reference to an Entity with name entityName.
 java.lang.String getErrorMessage(java.sql.SQLException e)
          Returns an error message corresponding to the exception e.
protected  java.lang.String getExtendedAliasPropertiesName()
          Gets the extended alias property file path.
protected  java.lang.String getExtendedPropertiesName()
          Gets the extended property file path.
 java.lang.String getExtension(java.lang.String transferId)
          This method returns null
 java.lang.String getName()
          Returns this entity's name.
 java.util.Vector getOrderColumns()
          Returns the list of columns (by name) to use in ORDER BY clause
 int getPrivilegedId()
          Returns the privileged identifier of this entity.
static java.lang.String getPropertiesPath(java.lang.String className)
           
 int getQueryRecordNumber(java.util.Hashtable keysValues, int sessionId)
          This method executes a count query against this entity's query table with the given conditions and for the session sessionId.
 java.lang.String getQueryTable()
          Returns the name of the table/view used when performing queries, if defined.
 long getSize(java.lang.String transferId)
          Returns the size of the attachment associated with the identifier transferId.
protected  java.util.Map getSQLTypesFromMetaData(java.util.List columns, int sessionId)
          Obtains the DB Column metadata
static java.util.Vector getStringsOn(java.lang.String s, java.lang.String separator)
          Parses the String s splitting it using separator as delimiter.
 java.util.Hashtable getSubGroupValues(java.util.Hashtable fieldsValues, java.util.Vector columns)
          Deprecated. @see getSubGroupValues(Hashtable, Vector, int)
 java.util.Hashtable getSubGroupValues(java.util.Hashtable fieldsValues, java.util.Vector columns, int sessionid)
          Creates a hashtable with the keys-values contained in fieldsValues that satisfy the condition that key is contained in columns.
 java.lang.String getTable()
          Returns the name of the table used when performing the four standard operations.
 java.util.Vector getUpdateColumns()
          Returns the list of columns (by name) that can be updated in update operations
protected  java.lang.String getUser(int sessionId)
          Returns the user name associated to the session identified by sessionId.
 java.util.Vector getValidAttributes(java.util.Vector attributes)
          Returns a list containing the valid attributes of those included in the vector attributes If column names have been specified for this entity, only attributes matching (case-sensitive) any of this column names are considered valid.
 java.util.Hashtable getValidDeletingKeysValues(java.util.Hashtable keysValues)
          Returns a hashtable containing a list of valid key-value pairs from those contained in the keysValues argument.
 java.util.Hashtable getValidInsertingAttributesValues(java.util.Hashtable attributesValues)
          Returns a hashtable containing a list of valid key-value pairs from those contained in the attributesValues argument.
 java.util.Hashtable getValidQueryingKeysValues(java.util.Hashtable keysValues)
          Returns a hashtable containing a list of valid key-value pairs from those contained in the keysValues argument.
 java.util.Hashtable getValidUpdatingAttributesValues(java.util.Hashtable attributesValues)
          Returns a hashtable containing a list of valid key-value pairs from those contained in the attributesValues argument.
 java.util.Hashtable getValidUpdatingKeysValues(java.util.Hashtable keysValues)
          Returns a hashtable containing a list of valid key-value pairs from those contained in the keysValues argument.
 java.util.Vector getWildCardColumns()
          Returns the list of columns (by name) which are allowed to use LIKE conditions in queries
 EntityResult insert(java.util.Hashtable attributesValues, int sessionId)
          This method implements a standard database insert operation with the data contained in attributesValues parameter.
 EntityResult insert(java.util.Hashtable attributesValues, int sessionId, java.sql.Connection con)
          Executes an insert operation with the provided Connection.
protected  EntityResult insertAutonumericalAlias(EntityResult res)
          Inserts the autonumerical column alias and the autonumerical value as key-value into the EntityResult res.
protected  boolean isBinaryType(int type)
           
protected  void loadAliasFile()
          Loads the alias properties.
protected  void loadAliasFile(java.lang.String path)
          Loads the alias properties file in path.
protected  void logToLogKeys(java.lang.String s)
          Logs the String s to the corresponding LogWriter.
protected  void logUpdate(java.util.Hashtable attributesValues, java.util.Hashtable keysValues, int sessionId)
          Logs an update operation with keys-values keysValues and attributes-values attributesValues The log is only performed if logUpdate is true.
static boolean parseStringValue(java.lang.String v, boolean defaultValue)
          Parses the string value as a boolean.
protected  java.util.Properties performExtendedAliasProperties(java.util.Properties prop)
          Performs the extended operation of alias property file.
protected  java.util.Properties performExtendedProperties(java.util.Properties prop)
          Performs the extended operation of entity property file.
 void postDelete(EntityResult deleteResult, java.util.Hashtable keysValues, int sessionId, java.sql.Connection con)
           
protected  void postInsert(EntityResult insertResult, java.util.Hashtable attributesValues, int sessionId, java.sql.Connection con)
           
 void postUpdate(EntityResult updateResult, java.util.Hashtable attributesValues, java.util.Hashtable keysValues, int sessionId, java.sql.Connection con)
           
 void preDelete(java.util.Hashtable keysValues, int sessionId, java.sql.Connection con)
           
protected  void preInsert(java.util.Hashtable attributesValues, int sessionId, java.sql.Connection con)
           
 java.lang.String prepareToReceive(java.util.Hashtable kv, java.lang.String fileName, java.lang.String fileDescription, int sessionId)
          This method calls prepareToReceive(Hashtable, String, String, String, int) with null argument for originalFilePath
 java.lang.String prepareToReceive(java.util.Hashtable keysValues, java.lang.String fileName, java.lang.String originalFilePath, java.lang.String fileDescription, int sessionId)
          Indicates to this entity that must be ready for receiving the contents of a file.
 java.lang.String prepareToReceive(java.lang.String column, java.util.Hashtable keysValues, int sessionId)
          Indicates to this entity that must be ready for receiving the contents of a file.
 java.lang.String prepareToTransfer(java.util.Hashtable keysValues, int sessionId)
          Indicates to this entity that a transfer process is going to start.
 java.lang.String prepareToTransfer(java.lang.String column, java.util.Hashtable keysValues, int sessionId)
          Indicates to this entity that a transfer process is going to start.
 void preUpdate(java.util.Hashtable attributesValues, java.util.Hashtable keysValues, int sessionId, java.sql.Connection con)
           
protected  java.util.Hashtable processFileColumnsAttributes(java.util.Hashtable av)
          Processes the Hashtable av using the fileInfoList information in this entity.
protected  java.util.Vector processFileColumnsAttributes(java.util.Vector list)
          Processes the Vector list using the information in fileInfoList.
protected  EntityResult processFileResults(EntityResult result)
          Processes the result object using the information in fileInfoList.
static java.util.Hashtable processingMultipleValueAttributes(java.util.Hashtable keysValues)
          Processes the MultipleValue objects contained in keysValues.
static java.util.Hashtable processingReferenceDataFieldAttributes(java.util.Hashtable keysValues)
          Processes the ReferenceFieldAttribute objects contained in keysValues.
static java.util.Vector processingReferenceDataFieldAttributes(java.util.Vector list)
          Processes the ReferenceFieldAttribute objects contained in list.
 java.util.Vector processMultipleAttributeKey(java.util.Vector list)
          Processes MultipleReferenceDataFieldAttribute objects contained in list.
protected  java.util.Hashtable processMultipleTableAttribute(java.util.Hashtable av)
          Processes all the MultipleTableAttribute contained as keys ih the Hashtable av.
protected  java.util.Vector processMultipleTableAttribute(java.util.Vector list, java.util.Vector processedMultipleAttributes)
          Processes all the MultipleTableAttribute contained in the Vector list.
 void putBytes(java.lang.String receivingId, BytesBlock bytesBlock, int sessionId)
          Adds the bytes contained in the bytesBlock object at the end of the file associated with the transfer identified by receivingId .
 EntityResult query(java.util.Hashtable keysValues, java.util.Vector attributes, int sessionId)
          This method implements a standard query operation returning the set of data that matches the conditions specified by the keysValues parameter.
 EntityResult query(java.util.Hashtable keysValues, java.util.Vector attributes, int sessionId, java.sql.Connection con)
          Executes a query operation using the provided Connection, with the conditions and attributes required.
 EntityResult query(java.util.Hashtable keysValues, java.util.Vector attributes, int sessionId, java.sql.Connection con, java.util.Vector orderColumns, boolean ascending)
          Executes a query using the provided connection.
 AdvancedEntityResult query(java.util.Hashtable filterKeys, java.util.Vector attributes, int sessionId, int recordCounter, int startIndex, java.lang.String sortBy, boolean desc)
          Deprecated.  
 AdvancedEntityResult query(java.util.Hashtable filterKeys, java.util.Vector attributes, int sessionId, int recordNumber, int startIndex, java.util.Vector orderBy)
           
 EntityResult queryOtherEntities(java.util.Vector attributes, EntityResult result, int sessionId)
          This method performs a query for each object of any of the following types contained in the Vector attributes: ReferenceFieldAttribute TableAttribute MultipleReferenceDataFieldAttribute A query is performed for each record in the argument result.
protected  void readProperties()
          Loads the properties file for this entity.
protected  void readProperties(java.util.Properties prop, java.net.URL uRLProp)
          Loads and analyzes the properties prop.
protected  void readProperties(java.lang.String path)
          Loads a Properties object located in path using this.getClass().getClassLoader().getResource(path).
static void registerAttributeDispatcher(java.lang.Class key, AttributeDispatcher dispatcher)
           
 void reloadScripts(boolean reloadNow)
           
 void removeEntityDataChangeListener(EntityDataChangeListener listener)
          Unregisters a EntityDataChangeListener to this entity.
 EntityResult replaceAliasByColumn(EntityResult res)
          This method loops through the keys of the EntityResult assuming that this keys are alias, and replacing this alias by the associated column if exists or leaving them unmodified if not.
 java.util.Hashtable replaceAliasByColumn(java.util.Hashtable hash)
          This method loops through the keys of the hashtable assuming that this keys are alias, and replacing this alias by the associated column if exists or leaving them unmodified if not.
protected  void replaceAliasByColumn(SQLStatementBuilder.BasicExpression bex)
           
 java.util.Vector replaceAliasByColumn(java.util.Vector columns, java.util.Hashtable changedColumns)
          Replaces the aliases contained in the list columns by the corresponding columns.
 java.util.Vector replaceAliasByColumn(java.util.Vector columns, java.util.Vector changedColumns)
          Replaces the alias contained in the list columns by the corresponding columns.
 EntityResult replaceColumnByAlias(EntityResult res, java.util.Hashtable replaceColumns)
          This method loops through the keys of the EntityResult and replaces them accordingly to the mapping defined by replaceColumns.
 EntityResult replaceColumnByAlias(EntityResult res, java.util.Vector replaceColumns)
          This method loops through the keys of the EntityResult assuming that this keys are columns, and replacing this columns by the associated alias if exists or leaving them unmodified if not.
 java.util.Hashtable replaceColumnByAlias(java.util.Hashtable hash)
          This method loops through the keys of the hashtable assuming that this keys are columns, and replacing this columns by the associated alias if exists or leaving them unmodified if not.
 java.util.Vector replaceColumnByAlias(java.util.Vector columns)
          Replaces the columns contained in the vector columns by the corresponding aliases.
 EntityResult replaceColumnByAliasKeepColumns(EntityResult res)
          This method loops through the keys of the EntityResult assuming that this keys are alias, and replacing this alias by the associated column if exists or leaving them unmodified if not.
static void resultSetToEntityResult(java.sql.ResultSet resultSet, EntityResult entityResult)
          Deprecated. You must use the resultSetToEntityResult for the specific statement handler instead (@see SQLStatementHandler
 void resultSetToEntityResult(java.sql.ResultSet resultSet, EntityResult entityResult, int recordNumber, int offset, boolean delimited)
           
 void resultSetToEntityResult(java.sql.ResultSet resultSet, EntityResult entityResult, java.util.List columnNames)
           
 void setLimitQueryOthersEntities(int lim)
          Sets the limitQueryOthersEntities variable to lim.
 void setName(java.lang.String name)
           
static void setObject(int index, java.lang.Object value, java.sql.PreparedStatement preparedStatement)
          Sets a parameter values in a prepared statement, at index index
static void setObject(int index, java.lang.Object value, java.sql.PreparedStatement preparedStatement, boolean truncDates)
          Sets a parameter value in a prepared statement, at index index The methods used are: setBlob for Blob objects setClob for Clob objects setBinaryStream for BytesBlock objects setCharacterStream for com.ontimize.gui.LongString setNull for com.ontimize.db.NullValue setObject for all other object
 void setPrivilegedId(int id)
          Establishes the privileged identifier for this entity
static java.util.Vector toVectorOfBooleans(java.util.Vector list)
          This method returns a vector of Boolean objects corresponding to the objects contained in the vector list.
static java.sql.Timestamp truncateDataToHour_00_00_00(java.util.Date date)
          Sets the following fields of the object date to zero: Calendar.MILLISECOND,Calendar.SECOND,Calendar.MINUTE,Calendar.HOUR_OF_DAY The default calendar (for the default locale and timezone) is used.
static java.sql.Timestamp truncateDateToMinutes(java.util.Date date)
          Sets the following fields of the object date to zero: Calendar.MILLISECOND,Calendar.SECOND The default calendar (for the default locale and timezone) is used.
 EntityResult update(java.util.Hashtable attributesValues, java.util.Hashtable keysValues, int sessionId)
          This method implements a standard update operation with the data specified in attributesValues over the set of records defined by keysValues.
 EntityResult update(java.util.Hashtable attributesValues, java.util.Hashtable keysValues, int sessionId, java.sql.Connection con)
          Executes an update operation with the provided Connection.
protected  void updateAttachmentValues(java.util.Hashtable keysValues, java.util.Hashtable attributesValues, int sessionId, java.sql.Connection connection)
           
static java.lang.String vectorToStringSeparateBySemicolon(java.util.Vector list)
          Generates a string containing the toString version of all the objects contained in the list list, separated by the ';' character
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

checkOperationResult

public static boolean checkOperationResult

LIMIT_QUERY_OTHERS_ENTITIES

public static final java.lang.String LIMIT_QUERY_OTHERS_ENTITIES
LimitQueryOtherEntities property.

See Also:
Constant Field Values

REPORT_ADVANCED_QUERY_TYPES

public static final java.lang.String REPORT_ADVANCED_QUERY_TYPES
report_advanced_query_types property.

See Also:
Constant Field Values

REPORT_ADVANCED_QUERY_COLUMNS

public static final java.lang.String REPORT_ADVANCED_QUERY_COLUMNS
ReportAdvancedQueryColumns property.

See Also:
Constant Field Values

ATTACHMENT_FILE_DESCRIPTION_COLUMN

public static final java.lang.String ATTACHMENT_FILE_DESCRIPTION_COLUMN
AttachmentFileDescriptionColumn property.

See Also:
Constant Field Values

ATTACHMENT_FILE_ORIGINAL_PATH_COLUMN

public static final java.lang.String ATTACHMENT_FILE_ORIGINAL_PATH_COLUMN
AttachmentFileOriginalPathColumn property.

See Also:
Constant Field Values

ATTACHMENT_FILE_ORIGINAL_NAME_COLUMN

public static final java.lang.String ATTACHMENT_FILE_ORIGINAL_NAME_COLUMN
AttachmentFileOriginalNameColumn property.

See Also:
Constant Field Values

ATTACHMENT_FILE_NAME_COLUMN

public static final java.lang.String ATTACHMENT_FILE_NAME_COLUMN
AttachmentFileNameColumn property.

See Also:
Constant Field Values

INSERT_AUTOMATICLY_ATTACHMENT

public static final java.lang.String INSERT_AUTOMATICLY_ATTACHMENT
InsertAutomaticlyAttachment property.

See Also:
Constant Field Values

ATTACHMENT_FILE_NAME_KEYS

public static final java.lang.String ATTACHMENT_FILE_NAME_KEYS
AttachmentFileNameKeys property.

See Also:
Constant Field Values

ATTACHMENT_FILE_SIZE_COLUMN

public static final java.lang.String ATTACHMENT_FILE_SIZE_COLUMN
AttachmentFileSizeColumn property.

See Also:
Constant Field Values

TABLE_ATTRIBUTE_ENTITIES

public static final java.lang.String TABLE_ATTRIBUTE_ENTITIES
Deprecated.  

TableAttributeEntities property.

See Also:
Constant Field Values

useAlwaysTableAttributeEntities

public static boolean useAlwaysTableAttributeEntities

ATTACHMENT_FILE_PATH

public static final java.lang.String ATTACHMENT_FILE_PATH
AttachmentFilePath property.

See Also:
Constant Field Values

FILE_COLUMNS

public static final java.lang.String FILE_COLUMNS
FileColumns property.

See Also:
Constant Field Values

LOG_KEYS

public static final java.lang.String LOG_KEYS
LogKeys property.

See Also:
Constant Field Values

AUTONUMERICAL

public static final java.lang.String AUTONUMERICAL
Autonumerical property.

See Also:
Constant Field Values

OTHER_ENTITIES

public static final java.lang.String OTHER_ENTITIES
OtherEntities property.

See Also:
Constant Field Values

SORT_DESC

public static final java.lang.String SORT_DESC
SortDesc property.

See Also:
Constant Field Values

SORT

public static final java.lang.String SORT
Sort property.

See Also:
Constant Field Values

WILDCARD_COLUMNS

public static final java.lang.String WILDCARD_COLUMNS
WildcardColumns property.

See Also:
Constant Field Values

INSERT_COLUMNS

public static final java.lang.String INSERT_COLUMNS
InsertColumns property.

See Also:
Constant Field Values

UPDATE_COLUMNS

public static final java.lang.String UPDATE_COLUMNS
UpdateColumns property.

See Also:
Constant Field Values

UPDATE_KEYS

public static final java.lang.String UPDATE_KEYS
UpdateKeys property.

See Also:
Constant Field Values

DELETE_KEYS

public static final java.lang.String DELETE_KEYS
DeleteKeys property.

See Also:
Constant Field Values

INSERT_KEYS

public static final java.lang.String INSERT_KEYS
InsertKeys property.

See Also:
Constant Field Values

KEYS

public static final java.lang.String KEYS
Keys property.

See Also:
Constant Field Values

COLUMNS

public static final java.lang.String COLUMNS
Columns property.

See Also:
Constant Field Values

AUTOCONFIGURATION

public static final java.lang.String AUTOCONFIGURATION
Autoconfiguration property.

See Also:
Constant Field Values

TRUNCATE_DATES

public static final java.lang.String TRUNCATE_DATES
TruncateDates property.

See Also:
Constant Field Values

FORCE_DISTINCT

public static final java.lang.String FORCE_DISTINCT
ForceDistinct property.

See Also:
Constant Field Values

ATTACHMENT_TABLE

public static final java.lang.String ATTACHMENT_TABLE
AttachmentTable property.

See Also:
Constant Field Values

QUERY_TABLE

public static final java.lang.String QUERY_TABLE
QueryTable property.

See Also:
Constant Field Values

FETCH_SIZE

public static final java.lang.String FETCH_SIZE
FetchSize property.

See Also:
Constant Field Values

TABLE

public static final java.lang.String TABLE
Table property.

See Also:
Constant Field Values

ASTERISK

public static char ASTERISK
The '*' character.


INTERROG

public static char INTERROG
The '?' character.


PERCENT

public static char PERCENT
The '%' character.


UNDERSCORE

public static char UNDERSCORE
The '_' character.


ATTACHMENT_SEPARATOR

public static java.lang.String ATTACHMENT_SEPARATOR
Character used for joining the keys while generating names for attachments in this entity. Default is '~'.


TRUNCATE_DATE_DEFAULT_VALUE

public static boolean TRUNCATE_DATE_DEFAULT_VALUE
Default value for truncate_date parameter.


RECORD_OPERATIONS

public static boolean RECORD_OPERATIONS
Specifies if standard operations are recorded by calling OperationRecorder.addOperation(). Use only for debugging and testing purposes.


M_IT_HAS_NOT_CHANGED_ANY_RECORD

public static final java.lang.String M_IT_HAS_NOT_CHANGED_ANY_RECORD
No records changed message key.

See Also:
Constant Field Values

M_ERROR_OPERATION

public static final java.lang.String M_ERROR_OPERATION
Operation error messsage key.

See Also:
Constant Field Values

DEBUG

public static boolean DEBUG
Debugging purposes variable. If enabled, debugging information will be sent to standard output.


DEBUG_DETAILS

public static boolean DEBUG_DETAILS
More debugging information.


DEBUG_TIMES

public static boolean DEBUG_TIMES
Debugging times variable. If enabled, operation timings will be output to standard out.


USE_SETSTRING_LONG_STRINGS

public static boolean USE_SETSTRING_LONG_STRINGS
Sets which method will be used in JDBC prepared statements for setting parameters of type string and length > 255. If this variable is false (default) setCharacterStream() will be used instead of setString()


entitiesPropertiesParser

protected static EntitiesPropertiesParser entitiesPropertiesParser

aliasPropertiesParser

protected static AliasPropertiesParser aliasPropertiesParser

QUERY_ACTION

public static final java.lang.String QUERY_ACTION
Key string used for checking action permissions for query operations. Default value is 'Query'.

See Also:
Constant Field Values

INSERT_ACTION

public static final java.lang.String INSERT_ACTION
Key string used for checking action permissions for insert operations. Default value is 'Insert'.

See Also:
Constant Field Values

UPDATE_ACTION

public static final java.lang.String UPDATE_ACTION
Key string used for checking action permissions for update operations. Default value is 'update'.

See Also:
Constant Field Values

DELETE_ACTION

public static final java.lang.String DELETE_ACTION
Key string used for checking action permissions for delete operations. Default value is 'Delete'.

See Also:
Constant Field Values

M_YOU_DO_NOT_HAVE_PERMISSION_TO_EXECUTE_ACTION

public static java.lang.String M_YOU_DO_NOT_HAVE_PERMISSION_TO_EXECUTE_ACTION
User has not rights to perfom action message key.


M_TEMPORALY_RESTRICTED_BY_PERMISSION_ACTION

public static java.lang.String M_TEMPORALY_RESTRICTED_BY_PERMISSION_ACTION
Operation restricted by time constraints message key.


M_LICENSE_PERMISSION_ERROR

public static java.lang.String M_LICENSE_PERMISSION_ERROR
License permission error mesage key.


dataChangeListeners

protected java.util.Vector dataChangeListeners
Contains registered DataChangeListeners.


table

protected java.lang.String table
The database table this entity performs operations with. This table is used for update, delete, insert and query operations. In query operations, if queryTable variable is defined, it is used instead of table


queryTable

protected java.lang.String queryTable
The database table/view that this entity queries for data.


attachTable

protected java.lang.String attachTable
Table name, used for query StandardAttachmentEntity to classify attachments by 'table name'+'table keys'. Defaults to table.


columnNames

protected java.util.Vector columnNames
List of columns defined by 'Columns' parameter.


keys

protected java.util.Vector keys
List of columns that define the primary key for this entity. Defined in 'keys' parameter.


insertKeys

protected java.util.Vector insertKeys
List of columns required (not null) to perform insert operations. Defined in 'insert_keys' parameter.


deleteKeys

protected java.util.Vector deleteKeys
List of columns required as Keys-Values to perform delete operations. Defined in 'delete_keys' parameter.


updateKeys

protected java.util.Vector updateKeys
List of columns required as Keys-Values to perform update operations. Defined in 'update_keys' parameter.


updateColumn

protected java.util.Vector updateColumn
List of columns in which update operations are allowed. Defined in 'update_columns' parameter.


manager

protected DatabaseConnectionManager manager
The DatabaseConnectionManager object, which provides DatabaseConnections to this entity.


autonumericalColumn

protected java.lang.String autonumericalColumn
Column in which numbers provided by Autonumerical object will be inserted in insert operations. Defined in 'autonumerical' parameter.


insertColumn

protected java.util.Vector insertColumn
List of columns valid insert operations. If not defined, columnNames will be used instead. Defined in 'insert_columns' parameter.


wildcardColumns

protected java.util.Vector wildcardColumns
List of columns in which special metacharacters ('%' and '?') are allowed for queries. If not defined, all string type columns are allowed. Defined in 'wildcard_columns'


orderColumns

protected java.util.Vector orderColumns
Columns used for specifying 'ORDER BY' SQL clause. The order will be ascending, and the columns will be written in the same order as they appear in the 'Sort' parameter.


descendantColumnsOrder

protected java.util.Vector descendantColumnsOrder
Columns used for specifying 'ORDER BY' SQL clause. The order will be descending, and the columns will be written in the same order as they appear in the 'SortDesc' parameter.


othersEntities

protected java.util.Vector othersEntities
Entities (by name) that will be queried for data related with records of this entity, when specified in attribute list. If not specified, all entities will be queried.


locator

protected EntityReferenceLocator locator
The EntityReferenceLocator for this entity.


limitQueryOthersEntities

protected int limitQueryOthersEntities
Maximum number of results of queries in this entity, for which related entities will be queried. For each result in this entity results, other entities will be queried for related data. Default is 100. Defined in 'limit_query_others_entities' parameter.


alias

protected java.util.Properties alias
Alias properties for this entity, if defined. If not, this properties object is empty.


aliasReverse

protected java.util.Hashtable aliasReverse
Reverse Alias properties for this entity, if defined. If not, this properties object is empty.


entityName

protected java.lang.String entityName
This entity name. The class name without '.class'.


privilegedId

protected int privilegedId
Privileged Id used for performing operations without checking permissions. As with other global class variables, modification of this variable must be carefully considered to avoid multiple threading problems.


forceDistinct

protected boolean forceDistinct
If true, a DISTINCT keyword will be added to all queries performed by this entity.


truncateDates

protected boolean truncateDates
If true, Date objects will be set to 00:00:00 when calling to setObject method of this class.


calendar

protected static java.util.Calendar calendar
Calendar object used internally.


attachmentFilePath

protected java.lang.String attachmentFilePath
Path in the file system in which the attached files for this entity will be stored. Defined by the 'AttachmentFilePath' parameter.


attachmentFileNameColumn

protected java.lang.String attachmentFileNameColumn
Column in the database table for storing the attachment filename. The name stored is generated automatically by getAttachmentFileNameForKeys() method. Defined by the 'attachment_file_name_column' parameter.


originalAttachmentFileNameColumn

protected java.lang.String originalAttachmentFileNameColumn
Column in the database table for storing the attachment original filename. Defined by the 'attachment_file_original_name_column' parameter.


originalAttachmentFilePathColumn

protected java.lang.String originalAttachmentFilePathColumn
Column in the database table for storing the attachment original file path. Defined by the 'attachment_file_original_path_column' parameter.


descriptionAttachmentFileColumn

protected java.lang.String descriptionAttachmentFileColumn
Column in the database table for storing the attachment user description.


insertAttachmentAutomatically

protected boolean insertAttachmentAutomatically
Defines if attachment records are inserted automatically. If false, a value for each key of this entity is required in the keysValues argument when calling to prepareToReceive method. These values will be used in the insert operation that is done in this method. Defined in 'insert_automatically_attachment' parameter. Default is false.


attachmentFileNameKeys

protected java.util.Vector attachmentFileNameKeys
Defines which column values are used when generating filenames for attachments, by calling getAttachmentFileNameForKeys() method. Defined in 'attachment_file_name_keys' parameter. By default, this variable is null.


attachmentFileSizeColumn

protected java.lang.String attachmentFileSizeColumn
Defines which column in the table will store the file size. Defined in 'attachment_file_size_column' parameter.


receivedAttachmentFile

protected java.util.Hashtable receivedAttachmentFile
Used internally for storing temporal AttachmentReceiving objects for current transfers.


sendAttachmentFile

protected java.util.Hashtable sendAttachmentFile
Used internally for storing temporal AttachmentReceiving objects for current transfers.


reportAvancedQueryColumns

protected java.util.Vector reportAvancedQueryColumns
List of columns for making advanced queries. Defined in 'report_advanced_query_columns' parameter.


reportAvancedQueryTypes

protected java.util.Vector reportAvancedQueryTypes
List of column types corresponding to columns defined in reportAvancedQueryColumns field. Defined in 'report_advanced_query_types' parameter.


logkeys

protected java.util.Vector logkeys
String keys for logging in this entity. These keys will be used for calling LogManager.getLogWriter(key) and then use resulting LogWriter for logging update, query, insert and delete operations. Defined in 'log_keys' parameter.


fetchSize

protected int fetchSize
Defines the JDBC statement fetch size. Defined in 'fetch_size' parameter. Default is 0.


PRINCIPAL_TABLE

public static final java.lang.String PRINCIPAL_TABLE
principal_table property.

See Also:
Constant Field Values

SECONDARY_TABLE

public static final java.lang.String SECONDARY_TABLE
secondary_table property.

See Also:
Constant Field Values

PRINCIPAL_COLUMNS

public static final java.lang.String PRINCIPAL_COLUMNS
principal_columns property.

See Also:
Constant Field Values

SECONDARY_COLUMNS

public static final java.lang.String SECONDARY_COLUMNS
secondary_columns property.

See Also:
Constant Field Values

PRINCIPAL_KEYS

public static final java.lang.String PRINCIPAL_KEYS
principal_keys property.

See Also:
Constant Field Values

SECONDARY_KEYS

public static final java.lang.String SECONDARY_KEYS
secondary_keys property.

See Also:
Constant Field Values

principalTable

protected java.lang.String principalTable
principal table when one2one mode is enabled.


secondaryTable

protected java.lang.String secondaryTable
secondary table when one2one mode is enabled.


principalColumnNames

protected java.util.Vector principalColumnNames
Column list for principal table when one2one mode is enabled.


secondaryColumnsNames

protected java.util.Vector secondaryColumnsNames
Column list for secondary table when one2one mode is enabled.


principalKeyName

protected java.util.Vector principalKeyName
Columns that make the primary key for this entity's principal table.


secondaryKeyName

protected java.util.Vector secondaryKeyName
Columns that make the primary key for this entity's secondary table.


dBLocalErrorMessage

protected DBLocalErrorMessages dBLocalErrorMessage
Used for customizing this entity's error messages. If 'err_nnnn' properties, where 'nnnn' is a SQLStateCode, are defined for this entity, this object will be automatically created and the messages will be added to it and used when any error happens.


oneToOneMode

protected boolean oneToOneMode
This mode is activated when the Entity models a 1-1 relation (One to One).
The syntax for the properties, assuming the tables P(a,b,c,d) and S(a,b,f,e), and that the union of which is the equivalent joined table (a,b,c,d,f,e) #Properties Table =P Columns =a;b;c;d;f;e Keys =a;b InsertKeys =a;b DeleteKeys =a;b UpdateKeys =a;b UpdateColumns =c;d;f;e Autonumerical=a #1-1 relation model PrincipalTable = P PrincipalColumns = a;b;c;d PrincipalKeys = a;b SecondaryTable = S SecondaryColumns = a;b;f;e SecondaryKeys = a;b


tempFiles

protected java.util.Hashtable tempFiles
Used internally.


receivedTempFiles

protected java.util.Hashtable receivedTempFiles
Used internally.


DEFAULT_MAX_CONNECTION_WAIT_TIME

public static int DEFAULT_MAX_CONNECTION_WAIT_TIME
Default connection request timeout.


TIME_BETWEEN_DEFAULT_CONNECTION_REQUEST

public static int TIME_BETWEEN_DEFAULT_CONNECTION_REQUEST
Default time between connection requests.


maxConnectionWaitTime

protected int maxConnectionWaitTime
Maximum connection request waiting time.


connectionRequestTime

protected int connectionRequestTime
Time between connection requests.


logQuery

protected boolean logQuery
Defines if query operations will be logged using the default LogWriter, if defined, or log writers specified by 'log_keys'. Default is false.


logInsert

protected boolean logInsert
Defines if insert operations will be logged using the default LogWriter, if defined, or log writers specified by 'log_keys'. Default is true.


logUpdate

protected boolean logUpdate
Defines if update operations will be logged using the default LogWriter, if defined, or log writers specified by 'log_keys'. Default is true.


logDelete

protected boolean logDelete
Defines if delete operations will be logged using the default LogWriter, if defined, or log writers specified by 'log_keys'. Default is true.


properties

protected java.util.Properties properties
Object for storing the properties of this entity.


propertiesPath

protected static java.lang.String propertiesPath
Default path used for looking properties file for this entity. The properties file should be located in /prop/entityName .properties, relative to this entity class file.


fileInfoList

protected com.ontimize.db.TableEntity.FileInfoList fileInfoList
List of FileInfo objects as defined by the 'file_columns' parameter.


entitiesTableAttribute

protected java.util.Vector entitiesTableAttribute
List of entity names for which the TableAttribute information (keys, attributes, ...) will be used when this entity queries another entities.

If an entity name is in this list, the columns of this entity defined as parentkeys in the TableAttribute, will be passed to the queried entity as filters.

Defined in 'TableAttributeEntities' parameter.

Default is null.


enableScripting

public static boolean enableScripting

defaultEntityScriptManagerClassName

public static java.lang.String defaultEntityScriptManagerClassName

entityScripting

protected IEntityScriptManager entityScripting

registeredDispatcher

protected static java.util.Hashtable registeredDispatcher
Constructor Detail

TableEntity

public TableEntity(EntityReferenceLocator locator,
                   DatabaseConnectionManager dbConnectionManager,
                   int port)
            throws java.lang.Exception
Constructor for objects of this class.

Parameters:
locator - The EntityReferenteLocator that this entity will use for getting references to other entities
dbConnectionManager - The DatabaseConnectionManager that provides database connections
port - The RMI port this object listens on
Throws:
java.lang.Exception - If creation of this object fails

TableEntity

public TableEntity(EntityReferenceLocator locator,
                   DatabaseConnectionManager dbConnectionManager,
                   int port,
                   java.util.Properties prop,
                   java.util.Properties aliasProp)
            throws java.lang.Exception
Method Detail

createEntityScriptManager

protected void createEntityScriptManager()

reloadScripts

public void reloadScripts(boolean reloadNow)

connect

public OntimizeConnection connect()
                           throws java.lang.Exception
Returns an OntimizeConnection by asking the DatabaseConnectionManager. This method waits a maximum of maxConnectionWaitTime if the DatabaseConnectionManager don´t provide a connection in the first attemps.

Returns:
an OntimizeConnection
Throws:
java.lang.Exception - if the DatabaseConnectionManager can´t provide a connection

connect

public OntimizeConnection connect(int userId)
                           throws java.lang.Exception
Returns an OntimizeConnection by asking the DatabaseConnectionManager. This method waits a maximum of maxConnectionWaitTime if the DatabaseConnectionManager don´t provide a connection in the first attemps.

Parameters:
userId - The userId to which the connection is related
Returns:
an OntimizeConnection
Throws:
java.lang.Exception - if the DatabaseConnectionManager can´t provide a connection

disconnect

public void disconnect(OntimizeConnection connection,
                       java.lang.String lockKey)
Returns the connection to the DatabaseConnectionManager, by calling unlock(connection) method.

The lockKey parameter must be equal to the connection lock key

Parameters:
connection - The connection to unlock
lockKey - May be null

disconnect

public void disconnect(OntimizeConnection connection)
Returns the connection to the DatabaseConnectionManager, by calling unlock(connection) method.

Parameters:
connection -

resultSetToEntityResult

public void resultSetToEntityResult(java.sql.ResultSet resultSet,
                                    EntityResult entityResult,
                                    int recordNumber,
                                    int offset,
                                    boolean delimited)
                             throws java.lang.Exception
Throws:
java.lang.Exception

resultSetToEntityResult

public void resultSetToEntityResult(java.sql.ResultSet resultSet,
                                    EntityResult entityResult,
                                    java.util.List columnNames)
                             throws java.lang.Exception
Throws:
java.lang.Exception

resultSetToEntityResult

public static void resultSetToEntityResult(java.sql.ResultSet resultSet,
                                           EntityResult entityResult)
                                    throws java.lang.Exception
Deprecated. You must use the resultSetToEntityResult for the specific statement handler instead (@see SQLStatementHandler

Transforms a java.sql.ResultSet object into an Ontimize EntityResult. The columns in the ResultSet are the keys in the EntityResult, and the values for the columns are stored in Vector objects corresponding to the keys in the EntityResult.

The following getxxxxx ResulSet methods are used for getting column data:

Parameters:
resultSet - the source ResultSet
entityResult - the destination EntityResult. It has a Hashtable of Vectors structure.
Throws:
java.lang.Exception - if any error (database, etc.) occurs

setObject

public static void setObject(int index,
                             java.lang.Object value,
                             java.sql.PreparedStatement preparedStatement)
                      throws java.sql.SQLException
Sets a parameter values in a prepared statement, at index index

Parameters:
index - the index of the parameter
value - the value to set
preparedStatement - the prepared statement
Throws:
java.sql.SQLException
See Also:
setObject

setObject

public static void setObject(int index,
                             java.lang.Object value,
                             java.sql.PreparedStatement preparedStatement,
                             boolean truncDates)
                      throws java.sql.SQLException
Sets a parameter value in a prepared statement, at index index

The methods used are:


Parameters:
index -
value -
preparedStatement -
truncDates -
Throws:
java.sql.SQLException

loadAliasFile

protected void loadAliasFile()
Loads the alias properties. By default, the alias properties file name is 'entityname'+'_alias.properties' and should be located on the same codebase as the properties file


loadAliasFile

protected void loadAliasFile(java.lang.String path)
Loads the alias properties file in path.

If file does not exist, no error is produced. If file exists, resulting alias are loaded in alias and aliasReverse fields.

Parameters:
path - the file location, relative to this entity's class file.

configureReverseAlias

protected void configureReverseAlias()

readProperties

protected void readProperties()
                       throws java.lang.Exception
Loads the properties file for this entity.
By default, the properties file name must be located in propertiesPath (by default 'prop') relative to this entity's class file, and named entityName.properties.

All the names specified in this file are considered database table columns, that is, should match exactly (case-sensitive) the columns of the database table/view.

The following table shows the parameters that can be defined in the properties file. For all parameters that define a list, the ';' character is used as separator.

Parameter Meaning Required
Table The database table name that this entity uses for query, insert, update, delete operations yes
QueryTable The database table or view name that this entity uses for query operations no
Columns Columns of the table specified in table parameter. Tipically it should be exactly all the table columns, but this is not strictly neccessary. These colums can be used in query, update, delete and insert operations (unless insert_columns parameter is defined) yes
InsertColumns Columns allowed in insert, update, delete operations. If not defined, columns is used instead no
Keys Columns that make the primary key for this entity. Usually matches the table primary key. yes
InsertKeys Columns required (non null) in insert operations. no
UpdateKeys Columns required in keysvalues (update method parameter). These columns, and only these, will be used in the WHERE clause of UPDATE SQL sentences. If not specified, keys is used. no
DeleteKeys Columns required in keysvalues (delete method parameter). These columns, and only these, will be used in the WHERE clause of DELETE SQL sentences. If not specified, keys is used.
UpdateColumns Columns that can be modified by update operations, calling update method. If not specified, no columns can be modified. no
Autonumerical Column that stores an integer generated by Autonumerical object when insert operations are performed. This column should never be specified in insert_keys parameter as is not provided to the method insert
but is generated internally in the method.
no
WildcardColumns Columns in whick special search characters are allowed for LIKE queries. If not specified, all columns are allowed. no
OtherEntities Entities (by name) that will be queried for data related with records of this entity, when specified in attribute list. If not specified, all entities will be queried. no
LimitQueryOtherEntities If there are multiple results for this entity, and other entity data is asked, then this entity will limit the number of records for which other entities are queried to this parameter. By default this value is 100 no
Sort List of column names to use in the ORDER BY clause, in the same order as they appear in this parameter. Since 5.2056EN-0.2, for specifying ascendant (ASC) and descendant (DESC) order individually for each column is accepted the syntax:
ASC[col1];DESC[col2];...;ASC[coln]
no
SortDesc Deprecated since 5.2056EN-0.2 (See Sort). List of column names to use in the ORDER BY DESC clause, in the same order as they appear in this parameter. If sort and sort_desc are specified, sort is used no
FetchSize The JDBC statement fetch size. By default this value is 0 no
LogKeys Specifies the keys for logging in this entity. These keys will be used for calling LogManager.getLogWriter(key) and then use resulting LogWriter for logging update, query, insert and delete operations no
FileColumns Specifies a list of columns for storing filename and file contents pairs, that this entity receives as com.ontimize.gui.DataFile objects.
This parameter is specified as a list of: attribute associated to file+':'+filename column+':'+file contents column, for each file to be stored.
e.g, your form contains two FileDataField with attr file1 and file2 and columns in database to store content for these ones are filecolumn1 and filecolumn2 and columns to store names are filenamecolumn1 and filenamecolumn2. So, configuration for this parameter would be:
FileColumns=file1:filenamecolumn1:filecolumn1;file2:filenamecolumn2:filecolumn2
no
ForceDistinct If this parameter is 'yes', then a DISTINCT keyword will be used in all queries performed by this entity. By default this value is 'no' no
TruncateDates If this value is 'yes' then the java.util.Date values will be set to 00:00:00 before being set in the statements. By default this value is 'no'. Default value can be configured with TRUNCATE_DATE_DEFAULT_VALUE field no
AttachmentFilePath Path in the file system in which the attached files for this entity will be stored. If this parameter is specified, then the parameter 'AttachmentFileNameColumn' also must be specified no
AttachmentFileNameColumn Column that stores the name of attached files. Must be String type. no
AttachmentFileOriginalNameColumn Column that stores original file names for attachments. no
AttachmentFileOriginalPathColumn Column that stores original file location (path) for attachments. This parameter is useful for custom code in the client no
AttachmentFileDescriptionColumn Column that stores optional attachment description. no
InsertAutomaticallyAttachment Defines if attachment records are inserted automatically. If false, a value for each key of this entity is required in the keysValues argument when calling to prepareToReceive method. These values will be used in the insert operation that is done in this method. Defined in 'InsertAutomaticallyAttachment' parameter. Default is false. no
AttachmentFileNameKeys Defines which column values are used when generating filenames for attachments, by calling getAttachmentFileNameForKeys() method. If this parameter is not specified, the columns defined in 'keys' are used. no
AttachmentFileSizeColumn Defines which column of the table is used for storing the attachment file size in bytes. Optional. no
TableAttributeEntities List of entity names for which the TableAttribute information (keys, attributes, ...) will be used when this entity queries another entities.

If an entity name is in this list, the columns of this entity defined as parentkeys in the TableAttribute, will be passed to the queried entity as filters.

no
Autoconfiguration If this parameter value is 'yes' then the configuration for this entity is automatically generated using the database metadata. Using this method, only a basic configuration can be obtained, and if possible, a properties file will be generated. no

When using attachments, the following basic actions must be granted for this entity:

Also, it is possible to define specific error messages for this entity when SQLExceptions ocurr. This can be done defining properties with the following format:
err_nnnn=error_message where nnnn is the SQLState associated with the exception. This method calls readProperties(String) with the standard location for this entity's properties file.

Throws:
java.lang.Exception

getPropertiesPath

public static java.lang.String getPropertiesPath(java.lang.String className)

readProperties

protected void readProperties(java.lang.String path)
                       throws java.lang.Exception
Loads a Properties object located in path using this.getClass().getClassLoader().getResource(path).
Then calls readProperties(Properties, URL)

Parameters:
path - path from which the properties will be loaded
Throws:
java.lang.Exception

getExtendedPropertiesName

protected java.lang.String getExtendedPropertiesName()
Gets the extended property file path. The extended property file must be in the same path that the entity property file.

Returns:
String with the file path.

getExtendedAliasPropertiesName

protected java.lang.String getExtendedAliasPropertiesName()
Gets the extended alias property file path. The extended alias property file must be in the same path that the alis property file.

Returns:
String with the file path.

performExtendedProperties

protected java.util.Properties performExtendedProperties(java.util.Properties prop)
Performs the extended operation of entity property file.

Parameters:
prop - Entity property file.
Returns:

performExtendedAliasProperties

protected java.util.Properties performExtendedAliasProperties(java.util.Properties prop)
Performs the extended operation of alias property file.

Parameters:
prop - Alias property file.
Returns:

readProperties

protected void readProperties(java.util.Properties prop,
                              java.net.URL uRLProp)
                       throws java.lang.Exception
Loads and analyzes the properties prop. The parameters for this entity are read from the properties and this entity is configured according to them.
If the 'autoconfiguration' parameter is specified and the uRLProp protocol is 'file', then a properties file is generated located in uRLProp.getPath()

Parameters:
prop - the properties object
uRLProp - the properties file URL
Throws:
java.lang.Exception

query

public EntityResult query(java.util.Hashtable keysValues,
                          java.util.Vector attributes,
                          int sessionId)
                   throws java.lang.Exception
This method implements a standard query operation returning the set of data that matches the conditions specified by the keysValues parameter. The attributes defines which attributes (or columns if data is obtained from a database) must be recovered, and keysValues specifies which set of records must be recovered.

This entity maps a table in the database, so all the hashtable keys must correspond to table columns, generally using column names as strings, but also other objects are processed.

This method ask for a connection and calls the following methods:

Then, if the result returned by query has no error, the queryOtherEntities(Vector , EntityResult , int ) method is called.
After that, this entity logs the operation if logQuery is true.
If an SQLException is thrown, the getErrorMessage(SQLException) method is called and the resulting messsage is set as the message in the EntityResult returned by this entity.

The result returned by query(Hashtable , Vector , int , Connection) method is returned by this method if no error ocurrs.

Specified by:
query in interface Entity
Parameters:
keysValues - a Hashtable specifying conditions that must comply the set of records returned. Cannot be null.
attributes - a list of columns that must be recovered for each record returned. Cannot be null. If empty, all attributes will be returned.
sessionId - a integer identifying the user or session that performs the action.
Returns:
a EntityResult with the resulting set of data. This result can be empty if no results exist, and if an error has occurred this will be indicated in the result.
Throws:
java.lang.Exception - if any non handled exception occurs
See Also:
query(Hashtable, Vector, int, Connection)

query

public AdvancedEntityResult query(java.util.Hashtable filterKeys,
                                  java.util.Vector attributes,
                                  int sessionId,
                                  int recordNumber,
                                  int startIndex,
                                  java.util.Vector orderBy)
                           throws java.lang.Exception
Specified by:
query in interface AdvancedEntity
Parameters:
filterKeys - a Hashtable specifying conditions that must comply the set of records returned. Cannot be null.
attributes - a list of columns that must be recovered for each record returned. Cannot be null. If empty, all attributes will be returned.
sessionId - a integer identifying the user or session that performs the action.
recordNumber - a integer establishing the number of records that will be returned.
startIndex - a integer establishing the position of the first record that will be returned.
orderBy - a Vector of String or SQLStatementBuilder.SQLOrder objects in where the column orderer is established.
Returns:
Throws:
java.lang.Exception

query

public AdvancedEntityResult query(java.util.Hashtable filterKeys,
                                  java.util.Vector attributes,
                                  int sessionId,
                                  int recordCounter,
                                  int startIndex,
                                  java.lang.String sortBy,
                                  boolean desc)
                           throws java.lang.Exception
Deprecated.  

Specified by:
query in interface AdvancedEntity
Parameters:
filterKeys -
attributes -
sessionId -
recordCounter -
startIndex -
sortBy -
desc -
Returns:
Throws:
java.lang.Exception

insert

public EntityResult insert(java.util.Hashtable attributesValues,
                           int sessionId)
                    throws java.lang.Exception
This method implements a standard database insert operation with the data contained in attributesValues parameter.

This entity maps a table in the database, so all the hashtable keys must correspond to table columns, generally using column names as strings, but also other objects are processed.

This method ask for a connection, set autocommit to false, so operations are processed in a transaction, and calls the following methods:

After this, commit is executed and if no error is produced a DataChangeEvent.INSERT_EVENT is thrown.
Also, if logInsert is true the operation is logged.

If an SQLException is thrown, the getErrorMessage(SQLException) method is called and the resulting message is set as the message in the EntityResult returned by this entity.

The result returned by insert(Hashtable , int , Connection) method is returned by this method if no error occurs.

If an autonumerical is defined for this entity and no error occurs, the value used in the insert operation is returned in the result as a pair or key-value where key is the column name, and value is the value used in the insert operation.

Specified by:
insert in interface Entity
Parameters:
attributesValues - a Hashtable specifying pairs of key-value corresponding to the attribute (or column of a table in a database) and the value that must be stored.
sessionId - a integer identifying the user or session that performs the action.
Returns:
an EntityResult with the operation result code and optional error message
Throws:
java.lang.Exception
See Also:
insert(Hashtable , int , Connection)

update

public EntityResult update(java.util.Hashtable attributesValues,
                           java.util.Hashtable keysValues,
                           int sessionId)
                    throws java.lang.Exception
This method implements a standard update operation with the data specified in attributesValues over the set of records defined by keysValues. So, only the records that comply with the conditions specified by keysValues will be updated to the new values specified by attributesValues.

This entity maps a table in the database, so all the hashtable keys must correspond to table columns, generally using column names as strings, but also other objects are processed.

This method ask for a connection, set autocommit to false, so operations are processed in a transaction, and calls the following methods:

After this, commit is executed and if no error is produced a DataChangeEvent.UPDATE_EVENT is thrown.
Also, if logInsert is true the operation is logged.

If an SQLException is thrown, the getErrorMessage(SQLException) method is called and the resulting message is set as the message in the EntityResult returned by this entity.

Specified by:
update in interface Entity
Parameters:
attributesValues - the data for updating the records to. The keys specify the attributes (or columns) and the values, the values for these columns.
keysValues - the conditions that the records to be updated must fulfill. The keys specify the attributes (or columns) and the values, the values for these columns.
sessionId - a integer identifying the user or session that performs the action.
Returns:
a EntityResult. This result will have an error code if error has occurred.
Throws:
java.lang.Exception - if any exception occurs
See Also:
update(Hashtable, Hashtable , int , Connection)

delete

public EntityResult delete(java.util.Hashtable keysValues,
                           int sessionId)
                    throws java.lang.Exception
This method must implement a standard delete operation over the set of records defined by keysValues. So, only the records that comply with the conditions specified by keysValues will be deleted.

This entity maps a table in the database, so all the hashtable keys must correspond to table columns, generally using column names as strings, but also other objects are processed.

This method ask for a connection, set autocommit to false, so operations are processed in a transaction, and calls the following methods:

After this, commit is executed and if no error is produced a DataChangeEvent.DELETE_EVENT is thrown.
Also, if logInsert is true the operation is logged.

If an SQLException is thrown, the getErrorMessage(SQLException) method is called and the resulting message is set as the message in the EntityResult returned by this entity.

Specified by:
delete in interface Entity
Parameters:
keysValues - the conditions that the records to be deleted must fulfill. The keys specify the attributes (or columns) and the values, the values for these columns.
sessionId - a integer identifying the user or session that performs the action.
Returns:
a EntityResult. This result will have an error code if error has occurred.
Throws:
java.lang.Exception - if any exception occurs
See Also:
delete(Hashtable, int , Connection)

getErrorMessage

public java.lang.String getErrorMessage(java.sql.SQLException e)
Returns an error message corresponding to the exception e.
If local error messages have been defined for this entity, are used first.
If not, the DBErrorMessages.getSQLStateMessage(int sqlState) is used, and if DBErrorMessages have not been defined, e.getMessage() is returned.

Parameters:
e - the exception
Returns:
the associated message

buildConditionsString

public java.lang.String buildConditionsString(java.util.Hashtable conditions,
                                              java.util.Vector values)
Returns a string containing the conditions to use after the WHERE keyword in the SQL sentence. This method calls the following methods:

Parameters:
conditions -
values -
Returns:
a string containing the conditions or null if no conditions exist.

toVectorOfBooleans

public static java.util.Vector toVectorOfBooleans(java.util.Vector list)
This method returns a vector of Boolean objects corresponding to the objects contained in the vector list.

For each position in the vector:

The list must contain only Boolean objects, Number objects or nulls.

Parameters:
list -
Returns:

setLimitQueryOthersEntities

public void setLimitQueryOthersEntities(int lim)
Sets the limitQueryOthersEntities variable to lim.

Parameters:
lim -
See Also:
limitQueryOthersEntities

getValidAttributes

public java.util.Vector getValidAttributes(java.util.Vector attributes)
Returns a list containing the valid attributes of those included in the vector attributes

If column names have been specified for this entity, only attributes matching (case-sensitive) any of this column names are considered valid.

If no columns have been defined, all attributes will be considered valid.

Parameters:
attributes -
Returns:
a Vector with the valid attributes

getValidQueryingKeysValues

public java.util.Hashtable getValidQueryingKeysValues(java.util.Hashtable keysValues)
Returns a hashtable containing a list of valid key-value pairs from those contained in the keysValues argument.

A key-value pair is valid if the key is valid.

If column names have been specified for this entity, only keys matching (case-sensitive) any of this column names are considered valid. Also, the special key SQLStatementBuilder.ExtendedSQLConditionValuesProcessor.EXPRESSION_KEY is always considered valid.

If no columns have been defined, all keys will be considered valid.

Parameters:
keysValues -
Returns:

getValidInsertingAttributesValues

public java.util.Hashtable getValidInsertingAttributesValues(java.util.Hashtable attributesValues)
Returns a hashtable containing a list of valid key-value pairs from those contained in the attributesValues argument.

A key-value pair is valid if the key is valid.

If insert columns have not been specified for this entity, getValidQueryingKeysValues(Hashtable) method is called and result is returned.

If not, the following is used:

Only keys matching (case-sensitive) any of this insert column names are considered valid.

Parameters:
attributesValues -
Returns:

getValidUpdatingAttributesValues

public java.util.Hashtable getValidUpdatingAttributesValues(java.util.Hashtable attributesValues)
Returns a hashtable containing a list of valid key-value pairs from those contained in the attributesValues argument.

A key-value pair is valid if the key is valid.

If column names have been specified for this entity, only keys matching (case-sensitive) any of this column names and any of the columns defined by the 'update_columns' parameter are considered valid.

If no columns have been defined, all keys contained in the update columns defined for this entity, will be considered valid.

Parameters:
attributesValues -
Returns:

getValidUpdatingKeysValues

public java.util.Hashtable getValidUpdatingKeysValues(java.util.Hashtable keysValues)
Returns a hashtable containing a list of valid key-value pairs from those contained in the keysValues argument.

A key-value pair is valid if the key is valid.

Only keys matching (case-sensitive) any of the columns defined by the 'update_keys' parameter are considered valid.

Parameters:
keysValues -
Returns:

getValidDeletingKeysValues

public java.util.Hashtable getValidDeletingKeysValues(java.util.Hashtable keysValues)
Returns a hashtable containing a list of valid key-value pairs from those contained in the keysValues argument.

A key-value pair is valid if the key is valid.

Only keys matching (case-sensitive) any of the columns defined by the 'delete_keys' parameter are considered valid.

Parameters:
keysValues -
Returns:

executePreparedStatement

public EntityResult executePreparedStatement(java.lang.String sqlSentence,
                                             java.util.Vector values)
                                      throws java.lang.Exception
Executes a prepared statement defined by sqlSentence and values.

This method ask for a connection and then calls executePreparedStatement(String, Vector, OntimizeConnection) returning the result.

Parameters:
sqlSentence - the SQL sentence
values - a list of values for the parameters in the SQL sentence
Returns:
Throws:
java.lang.Exception

executePreparedStatement

public EntityResult executePreparedStatement(java.lang.String sqlSentence,
                                             java.util.Vector values,
                                             int sessionId)
                                      throws java.lang.Exception
Executes a prepared statement defined by sqlSentence and values.

This method ask for a connection, calling connect(int) with sessionId, and then calls executePreparedStatement(String, Vector, OntimizeConnection) returning the result.

Parameters:
sqlSentence - the SQL sentence
values - a list of values for the parameters in the SQL sentence
sessionId -
Returns:
Throws:
java.lang.Exception

executePreparedStatement

public EntityResult executePreparedStatement(java.lang.String sqlSentence,
                                             java.util.Vector values,
                                             int recordNumber,
                                             int offset,
                                             boolean delimited,
                                             int sessionId)
                                      throws java.lang.Exception
Executes a prepared statement defined by sqlSentence and values.

This method ask for a connection, calling connect(int) with sessionId, and then calls executePreparedStatement(String, Vector, OntimizeConnection) returning the result.

Parameters:
sqlSentence - the SQL sentence
values - a list of values for the parameters in the SQL sentence
recordNumber - number of record to retrieve
offset - index of the record to retrieve
sessionId -
Returns:
Throws:
java.lang.Exception

executePreparedStatement

public EntityResult executePreparedStatement(java.lang.String sqlSentence,
                                             java.util.Vector values,
                                             OntimizeConnection con)
                                      throws java.lang.Exception
Executes a prepared statement defined by sqlSentence and values.

This method calls {@link #executePreparedStatement(String, Vector, OntimizeConnection, int) returning the result.

Parameters:
sqlSentence - the SQL sentence
values - a list of values for the parameters in the SQL sentence
con -
Returns:
Throws:
java.lang.Exception

executePreparedStatement

public EntityResult executePreparedStatement(java.lang.String sqlSentence,
                                             java.util.Vector values,
                                             int recordNumber,
                                             int offset,
                                             boolean delimited,
                                             OntimizeConnection con,
                                             int sessionId)
                                      throws java.lang.Exception
Executes the SQL sentence sqlSentence with the parameter list values.

This method uses the supplied connection con but does not disconnect it.

Creates a PreparedStatement, sets the parameters by calling setObject(int, Object, PreparedStatement, boolean), and executes the statement.

If the operation produces a ResultSet, then this ResultSet is read by calling resultSetToEntityResult(ResultSet, EntityResult) and the EntityResult is returned.

If the sessionId has a compression threshold associated, then it is set in the returned result.

If the operation does not produce a ResultSet the statement is queried for update count and if the result is zero, a warning message (M_IT_HAS_NOT_CHANGED_ANY_RECORD) is set in an empty EntityResult that is returned.

Finally this method closes the PreparedStatement.

Parameters:
sqlSentence - the sentence to execute
values - the corresponding parameter values
con - the connection to use when creating the PreparedStatement
sessionId - the user identifier
Returns:
an EntityResult with data if a query is performed, or empty in other cases.
Throws:
java.lang.Exception - if an error occurs

executePreparedStatement

public EntityResult executePreparedStatement(java.lang.String sqlSentence,
                                             java.util.Vector values,
                                             OntimizeConnection con,
                                             int sessionId)
                                      throws java.lang.Exception
Executes the SQL sentence sqlSentence with the parameter list values.

This method uses the supplied connection con but does not disconnect it.

Creates a PreparedStatement, sets the parameters by calling setObject(int, Object, PreparedStatement, boolean), and executes the statement.

If the operation produces a ResultSet, then this ResultSet is read by calling resultSetToEntityResult(ResultSet, EntityResult) and the EntityResult is returned.

If the sessionId has a compression threshold associated, then it is set in the returned result.

If the operation does not produce a ResultSet the statement is queried for update count and if the result is zero, a warning message (M_IT_HAS_NOT_CHANGED_ANY_RECORD) is set in an empty EntityResult that is returned.

Finally this method closes the PreparedStatement.

Parameters:
sqlSentence - the sentence to execute
values - the corresponding parameter values
con - the connection to use when creating the PreparedStatement
sessionId - the user identifier
Returns:
an EntityResult with data if a query is performed, or empty in other cases.
Throws:
java.lang.Exception - if an error ocurrs

executePreparedStatement

public EntityResult executePreparedStatement(java.lang.String sqlSentence,
                                             java.util.Vector values,
                                             java.sql.Connection con,
                                             int sessionId)
                                      throws java.lang.Exception
Executes the SQL sentence sqlSentence with the parameter list values.

This method uses the supplied connection con but does not disconnect it.

Creates a PreparedStatement, sets the parameters by calling setObject(int, Object, PreparedStatement, boolean), and executes the statement.

If the operation produces a ResultSet, then this ResultSet is read by calling resultSetToEntityResult(ResultSet, EntityResult) and the EntityResult is returned.

If the sessionId has a compression threshold associated, then it is set in the returned result.

If the operation does not produce a ResultSet the statement is queried for update count and if the result is zero, a warning message (M_IT_HAS_NOT_CHANGED_ANY_RECORD) is set in an empty EntityResult that is returned.

Finally this method closes the PreparedStatement.

Parameters:
sqlSentence - the sentence to execute
values - the corresponding parameter values
con - the connection to use when creating the PreparedStatement
sessionId - the user identifier
Returns:
an EntityResult with data if a query is performed, or empty in other cases.
Throws:
java.lang.Exception - if an error ocurrs

queryOtherEntities

public EntityResult queryOtherEntities(java.util.Vector attributes,
                                       EntityResult result,
                                       int sessionId)
This method performs a query for each object of any of the following types contained in the Vector attributes:

A query is performed for each record in the argument result.

For ReferenceFieldAttribute and MultipleReferenceDataFieldAttribute objects, the object information (entity, columns, cods, attrs) is used to perform the query.

For TableAttribute objects, if the entity specified in the object is defined in this entity's 'TableAttributeEntities' parameter, then the TableAttribute object information ( parentkeys) is used when performed the query, that is, the keysValues passed to the Entity's query method will contain for each record in result the values for each column in the parentkeys.

If the entity specified in the TableAttribute object is not defined in 'TableAttributeEntities', then the keys of this entity are used.

Also, for TableAttribute objects, if 'other_entities' parameter is defined, only those objects with entity name matches any of the names defined by this parameter, will lead to a query execution. If the result contains more records than the value of limitQueryOthersEntities field, only the first limitQueryOthersEntities will be queried.

When querying other entities, if this and these entities are instances of PrivilegedSecurityEntity, and this entity is queried with a privileged Id, a privileged Id is set and used with other entities when querying.

The resulting data is added to the result object using as keys, the associated objects in attributes.

So, if a ReferenteFieldAttribute is found, a query is performed and the result is added to result using as key the ReferenceFieldAttribute.

Parameters:
attributes -
result - With the column names without the alias. If there is no data for column names then use the alias values.
sessionId -
Returns:
the same result object received as argument with additional data
See Also:
TableAttribute, ReferenceFieldAttribute

registerAttributeDispatcher

public static void registerAttributeDispatcher(java.lang.Class key,
                                               AttributeDispatcher dispatcher)

dispatcherAttribute

protected void dispatcherAttribute(java.lang.Object attribute,
                                   EntityResult result,
                                   int sessionId)

checkInsertKeys

public void checkInsertKeys(java.util.Hashtable attributesValues)
                     throws java.lang.Exception
Checks if attributesValues contains a value for all columns defined in 'insert_keys' parameter.

Parameters:
attributesValues -
Throws:
java.lang.Exception - if any of the columns defined in 'insert_keys' is not found as key in attributesValues

checkUpdateKeys

public void checkUpdateKeys(java.util.Hashtable keysValues)
                     throws java.lang.Exception
Checks if keysValues contains a value for all columns defined in 'update_keys' parameter.

Parameters:
keysValues -
Throws:
java.lang.Exception - if any of the columns defined in 'update_keys' is not found as key in keysValues

checkDeleteKeys

public void checkDeleteKeys(java.util.Hashtable keysValues)
                     throws java.lang.Exception
Checks if keysValues contains a value for all columns defined in 'delete_keys' parameter.

Parameters:
keysValues -
Throws:
java.lang.Exception - if any of the columns defined in 'delete_keys' is not found as key in keysValues

getAliasForColumn

public java.lang.String getAliasForColumn(java.lang.String column)
Returns an alias for the column column if it has been specified.

Parameters:
column -
Returns:
the alias for the column or null if column has not alias

getColumnForAlias

public java.lang.String getColumnForAlias(java.lang.String alias)
Returns the column for the alias alias if alias have been defined and the alias specified corresponds to a column.

Parameters:
alias -
Returns:
the column that has the alias alias or null if no column has this alias.

replaceAliasByColumn

public java.util.Hashtable replaceAliasByColumn(java.util.Hashtable hash)
This method loops through the keys of the hashtable assuming that this keys are alias, and replacing this alias by the associated column if exists or leaving them unmodified if not. The values associated to the keys are kept.

Parameters:
hash -
Returns:
a new Hashtable object with the same values and replaced keys

replaceAliasByColumn

protected void replaceAliasByColumn(SQLStatementBuilder.BasicExpression bex)

replaceColumnByAlias

public java.util.Hashtable replaceColumnByAlias(java.util.Hashtable hash)
This method loops through the keys of the hashtable assuming that this keys are columns, and replacing this columns by the associated alias if exists or leaving them unmodified if not. The values associated to the keys are kept.

Parameters:
hash -
Returns:
a new Hashtable object with the same values and replaced keys

replaceAliasByColumn

public EntityResult replaceAliasByColumn(EntityResult res)
This method loops through the keys of the EntityResult assuming that this keys are alias, and replacing this alias by the associated column if exists or leaving them unmodified if not. The values associated to the keys are kept.

Parameters:
res -
Returns:
a new EntityResult object with the same values and replaced keys

replaceColumnByAlias

public EntityResult replaceColumnByAlias(EntityResult res,
                                         java.util.Vector replaceColumns)
This method loops through the keys of the EntityResult assuming that this keys are columns, and replacing this columns by the associated alias if exists or leaving them unmodified if not. The values associated to the keys are kept.

Only the columns contained in replaceColumns are replaced in the result.

Parameters:
res -
replaceColumns -
Returns:
a new EntityResult object with the same values and replaced keys

replaceColumnByAlias

public EntityResult replaceColumnByAlias(EntityResult res,
                                         java.util.Hashtable replaceColumns)
This method loops through the keys of the EntityResult and replaces them accordingly to the mapping defined by replaceColumns.

So, if any of the keys of result is found in replaceColumns, it is replaced by the value associated (replaceColumns.get(key))

Parameters:
res -
replaceColumns -
Returns:
a new EntityResult object with the same values and replaced keys

replaceColumnByAliasKeepColumns

public EntityResult replaceColumnByAliasKeepColumns(EntityResult res)
This method loops through the keys of the EntityResult assuming that this keys are alias, and replacing this alias by the associated column if exists or leaving them unmodified if not. The values associated to the keys are kept.

The original keys (and values) are also copied to the result.

Parameters:
res -
Returns:
a new EntityResult object with the same values and replaced keys

replaceAliasByColumn

public java.util.Vector replaceAliasByColumn(java.util.Vector columns,
                                             java.util.Vector changedColumns)
Replaces the alias contained in the list columns by the corresponding columns.

The replaced columns (not the alias) are added to the vector changedColumns

Parameters:
columns -
changedColumns -
Returns:
a Vector containing a list of columns corresponding to the columns contained in columns and the columns corresponding to alias contained in columns, if any.

replaceAliasByColumn

public java.util.Vector replaceAliasByColumn(java.util.Vector columns,
                                             java.util.Hashtable changedColumns)
Replaces the aliases contained in the list columns by the corresponding columns.

The replaced columns and alias are added to the hashtable changedColumns as a key-value pair in the form column-alias

Parameters:
columns -
changedColumns -
Returns:
a Vector containing a list of columns corresponding to the columns contained in columns and the columns corresponding to alias contained in columns, if any.

replaceColumnByAlias

public java.util.Vector replaceColumnByAlias(java.util.Vector columns)
Replaces the columns contained in the vector columns by the corresponding aliases.

The objects with no corresponding aliases are added with no changes.

Parameters:
columns -
Returns:

checkFinishedSession

public void checkFinishedSession(int sessionId)
                          throws GeneralSecurityException
Checks if the sessionId has an associated session. The method throws an exception if a session is not found.

Parameters:
sessionId - the identifier to check
Throws:
GeneralSecurityException - if a session is not found for identifier sessionId

checkPermissions

public void checkPermissions(int sessionId,
                             java.lang.String action)
                      throws NotInPeriodException,
                             GeneralSecurityException,
                             SessionNotFoundException
Checks if the user/session identified by sessionId has the permission defined by action

This method calls ServerManager.getServerSecurityManager() and then, if a manager exists, calls manager.checkActionPermission(int, String, String)

Parameters:
sessionId - the identifier to check
action - the action to check
Throws:
NotInPeriodException - if the action is restricted by time constraints
GeneralSecurityException - it the action is not allowed
SessionNotFoundException - if the identifier sessionId has not an associated session.

setPrivilegedId

public void setPrivilegedId(int id)
Establishes the privileged identifier for this entity

Specified by:
setPrivilegedId in interface PrivilegedSecurityEntity
Parameters:
id - the identifier that will be the privileged one. Must be < 0, but this is not imposed in this method.

getPrivilegedId

public int getPrivilegedId()
Returns the privileged identifier of this entity.

Specified by:
getPrivilegedId in interface PrivilegedSecurityEntity
Returns:
the identifier

getActions

public java.util.Vector getActions()
                            throws java.lang.Exception
Returns the actions that this entity can perform. This method by default returns the four standard actions.

Specified by:
getActions in interface SecureEntity
Returns:
a vector with the action's string identifiers
Throws:
java.lang.Exception

getName

public java.lang.String getName()
                         throws java.lang.Exception
Returns this entity's name. The value is stored in the field entityName

Specified by:
getName in interface SecureEntity
Returns:
this entity's name
Throws:
java.lang.Exception

getDescription

public java.lang.String getDescription()
                                throws java.lang.Exception
Returns a description for this entity. By default this method calls getName()

Specified by:
getDescription in interface SecureEntity
Returns:
a description for this entity
Throws:
java.lang.Exception

getQueryTable

public java.lang.String getQueryTable()
Returns the name of the table/view used when performing queries, if defined.

Returns:
a table/view name

getTable

public java.lang.String getTable()
Returns the name of the table used when performing the four standard operations.

Returns:
a table name

processingReferenceDataFieldAttributes

public static java.util.Hashtable processingReferenceDataFieldAttributes(java.util.Hashtable keysValues)
Processes the ReferenceFieldAttribute objects contained in keysValues.

Returns a hashtable containing all the objects contained in the argument keysValues except in the case of keys that are ReferenceFieldAttribute objects, which are replaced by ((ReferenceFieldAttribute)object).getAttr()

Parameters:
keysValues - the keysValues to process
Returns:
a hashtable containing the processed objects

processingReferenceDataFieldAttributes

public static java.util.Vector processingReferenceDataFieldAttributes(java.util.Vector list)
Processes the ReferenceFieldAttribute objects contained in list.

Returns a Vector containing all the objects in the argument list except in the case of keys that are ReferenceFieldAttribute objects, which are maintained but also ((ReferenceFieldAttribute)object).getAttr() is added

Parameters:
list - the list to process
Returns:
a vector containing the processed objects

getQueryRecordNumber

public int getQueryRecordNumber(java.util.Hashtable keysValues,
                                int sessionId)
                         throws java.lang.Exception
This method executes a count query against this entity's query table with the given conditions and for the session sessionId.

Parameters:
keysValues - the conditions that the records must fulfill
sessionId - the session identifier
Returns:
the number of records
Throws:
java.lang.Exception - if a database error ocurrs

getSize

public long getSize(java.lang.String transferId)
             throws java.lang.Exception
Returns the size of the attachment associated with the identifier transferId.

Specified by:
getSize in interface FileManagementEntity
Parameters:
transferId -
Returns:
the attachment size in bytes
Throws:
java.lang.Exception - if a transfer for the identifier is not found

getExtension

public java.lang.String getExtension(java.lang.String transferId)
                              throws java.lang.Exception
This method returns null

Specified by:
getExtension in interface FileManagementEntity
Parameters:
transferId -
Returns:
null
Throws:
java.lang.Exception

prepareToTransfer

public java.lang.String prepareToTransfer(java.util.Hashtable keysValues,
                                          int sessionId)
                                   throws java.lang.Exception
Indicates to this entity that a transfer process is going to start. The keysValues identify the record that has associated the file, and the sessionId identifies the caller user/session.

A checkPermissions() with TableEntity.QUERY_ACTION is executed, so this action must be granted to the caller.

Specified by:
prepareToTransfer in interface FileManagementEntity
Parameters:
keysValues - the keys-values that identify the record to which the file is linked
sessionId - the session identifier
Returns:
a String identifier for the transfer, that must be used when asking for new bytes
Throws:
java.lang.Exception - if an error ocurrs

prepareToTransfer

public java.lang.String prepareToTransfer(java.lang.String column,
                                          java.util.Hashtable keysValues,
                                          int sessionId)
                                   throws java.lang.Exception
Indicates to this entity that a transfer process is going to start. The keysValues identify the record that will have associated the transferred object, and the sessionId identifies the caller user/session.

A checkPermissions() with TableEntity.QUERY_ACTION is executed, so this action must be granted to the caller.

Specified by:
prepareToTransfer in interface FileManagementEntity
Parameters:
column - the table column that stores the file contents. Must be VARBINARY or LONGVARBINARY type
keysValues - the keys-values that identify the record to which the file must be linked
sessionId - the session identifier
Returns:
a String identifier for the transfer, that must be used when asking for new bytes
Throws:
java.lang.Exception - if an error ocurrs

isBinaryType

protected boolean isBinaryType(int type)

prepareToReceive

public java.lang.String prepareToReceive(java.lang.String column,
                                         java.util.Hashtable keysValues,
                                         int sessionId)
                                  throws java.lang.Exception
Indicates to this entity that must be ready for receiving the contents of a file. The file will be associated (linked) to the record identified by keysValues. The method returns a String identifier for use when sending new bytes.

Specified by:
prepareToReceive in interface FileManagementEntity
Parameters:
column - the table column that will store the file, if it must be stored in the database, or null if it must be stored in file system
keysValues - the keys-values that identify the record to which the file is linked
sessionId - the caller id
Returns:
an identifier
Throws:
java.lang.Exception - in an error ocurrs.

getAttachmentFileNameForKeys

protected java.lang.String getAttachmentFileNameForKeys(java.lang.String fileName,
                                                        java.util.Hashtable keysValues)
                                                 throws java.lang.Exception
Returns the attachment file name associated to the record identified by keysValues.

The file name is generated concatenating the values of this entity's keys (in the same order as they were defined) in the record identified by keysValues separated by ATTACHMENT_SEPARATOR plus a '.' and the extension part of the name fileName.

Parameters:
fileName - the base file name. Cannot be null
keysValues - the keys-values that identify a record
Returns:
the attachment file name
Throws:
java.lang.Exception - if fileName is null, keysValues is null or empty or a key has not value in the record

prepareToReceive

public java.lang.String prepareToReceive(java.util.Hashtable kv,
                                         java.lang.String fileName,
                                         java.lang.String fileDescription,
                                         int sessionId)
                                  throws java.lang.Exception
This method calls prepareToReceive(Hashtable, String, String, String, int) with null argument for originalFilePath

Specified by:
prepareToReceive in interface FileManagementEntity
Throws:
java.lang.Exception

prepareToReceive

public java.lang.String prepareToReceive(java.util.Hashtable keysValues,
                                         java.lang.String fileName,
                                         java.lang.String originalFilePath,
                                         java.lang.String fileDescription,
                                         int sessionId)
                                  throws java.lang.Exception
Indicates to this entity that must be ready for receiving the contents of a file. The file will be associated (linked) to the record identified by keysValues. The method returns a String identifier for use when sending new bytes.

This method performs a query, so QUERY_ACTION must be granted to the caller.

If insertAttachmentAutomatically is true, then a new record is automatically inserted using the values contained in keysValues. (So, INSERT_ACTION must be granted.)

The supplied fileName, originalFilePath and fileDescription will be used when inserting if not null and attachmentFileNameColumn, originalAttachmentFileNameColumn and descriptionAttachmentFileColumn are not null.

If insertAttachmentAutomatically is false, a record must exist.

Specified by:
prepareToReceive in interface FileManagementEntity
Parameters:
keysValues - the keys-values that identify the record or the new values for the new record
fileName - the attachment file name. The resulting file name will be the generated by a call to getAttachmentFileNameForKeys. May be null
originalFilePath - may be null
fileDescription - an optional file description. May be null
sessionId - the caller id
Returns:
a identifier for the transfer
Throws:
java.lang.Exception - if attachment file path or attachment filename column are null for this entity, or an error ocurrs

getBytes

public BytesBlock getBytes(java.lang.String transferId,
                           int offset,
                           int length,
                           int sessionId)
                    throws java.lang.Exception
Returns a BytesBlock object containing a byte array of length lengthstarting in offset offset for the attachment identified by transferId

If offset+length is greater than the file size only file size-offset bytes are returned.

Specified by:
getBytes in interface FileManagementEntity
Parameters:
transferId - the transfer identifier
offset - the start offset
length - the number of bytes to return
sessionId - the caller identifier
Returns:
a BytesBlock or null if offset is greater than the file size.
Throws:
java.lang.Exception - if a transfer for transferId is not found.

putBytes

public void putBytes(java.lang.String receivingId,
                     BytesBlock bytesBlock,
                     int sessionId)
              throws java.lang.Exception
Adds the bytes contained in the bytesBlock object at the end of the file associated with the transfer identified by receivingId

. If a write error ocurrs, the transfer identified by receivingId is cancelled.

Specified by:
putBytes in interface FileManagementEntity
Parameters:
receivingId -
bytesBlock -
sessionId -
Returns:
Throws:
java.lang.Exception - if a transfer for receivingId is not found or a transfer or write error ocurrs

finishReceiving

public boolean finishReceiving(java.lang.String receivingId,
                               int sessionId)
                        throws java.lang.Exception
Indicates to this entity that the transfer identified by receivingId has finished.

This means that the file is complete and the table record associated to this transfer must be updated with the file information (file name, size, etc.)

The transfer identifier is removed from current transfers. If an error ocurrs, the transfer is cancelled.

If the file must be stored in the table this update operation will include also the file contents.

If the record has a previous attachment, this attachment is deleted.

An UPDATE_ACTION must be granted to the caller.

Specified by:
finishReceiving in interface FileManagementEntity
Parameters:
receivingId - the transfer identifier
sessionId - the caller identifier
Returns:
a boolean indicating if the file is stored on the file system or in the table
Throws:
java.lang.Exception - if an error ocurrs.

updateAttachmentValues

protected void updateAttachmentValues(java.util.Hashtable keysValues,
                                      java.util.Hashtable attributesValues,
                                      int sessionId,
                                      java.sql.Connection connection)
                               throws java.lang.Exception
Throws:
java.lang.Exception

cancelReceiving

public void cancelReceiving(java.lang.String receivingId,
                            int sessionId)
                     throws java.lang.Exception
Cancells the transfer identified by receivingId.

An UPDATE_ACTION and DELETE_ACTION (if record was created when the transfer started) must be granted to the caller.

The temporal file is deleted and if a record was created is also deleted

Specified by:
cancelReceiving in interface FileManagementEntity
Parameters:
receivingId - the transfer identifier
sessionId -
Throws:
java.lang.Exception - if an error ocurrs or if the user has not the rights to perform the action

getUser

protected java.lang.String getUser(int sessionId)
Returns the user name associated to the session identified by sessionId.

This method calls the SecureReferenceLocator getUser(int) method if the locator for this entity is a SecureReferenceLocator. If not, if locator is ReferenceLocator, getUser() is called.

Parameters:
sessionId -
Returns:
the user name or null if cannot be determined

createAdvancedEntityResultForSessionId

public AdvancedEntityResult createAdvancedEntityResultForSessionId(int cod,
                                                                   int type,
                                                                   int sessionId)
Utility method for creating an AdvancedEntityResult for the session identified by sessionId

. Basically this method creates an AdvancedEntityResult and sets its compression threshold.

Parameters:
cod -
type -
sessionId -
Returns:

createAdvancedEntityResultForSessionId

public AdvancedEntityResult createAdvancedEntityResultForSessionId(int cod,
                                                                   int type,
                                                                   java.lang.String message,
                                                                   int sessionId)
Utility method for creating an AdvancedEntityResult for the session identified by sessionId

. Basically this method creates an AdvancedEntityResult and sets its compression threshold.

Parameters:
cod -
type -
message -
sessionId -
Returns:

createEntityResultForSessionId

public EntityResult createEntityResultForSessionId(int cod,
                                                   int type,
                                                   java.lang.String message,
                                                   int sessionId)
Utility method for creating an EntityResult for the session identified by sessionId

. Basically this method creates an EntityResult and sets its compression threshold.

Parameters:
cod -
type -
message -
sessionId -
Returns:

createEntityResultForSessionId

public static EntityResult createEntityResultForSessionId(EntityReferenceLocator locator,
                                                          int cod,
                                                          int type,
                                                          java.lang.String message,
                                                          int sessionId)
Utility method for creating an EntityResult for the session identified by sessionId

. Basically this method creates an EntityResult and sets its compression threshold.

This method uses the suppied EntityReferenceLocator for getting the compression threshold for the session sessionId

Parameters:
locator -
cod -
type -
message -
sessionId -
Returns:

createEntityResultForSessionId

public EntityResult createEntityResultForSessionId(int cod,
                                                   int type,
                                                   int sessionId)
Utility method for creating an EntityResult for the session identified by sessionId

. Basically this method creates an EntityResult and sets its compression threshold.

Parameters:
cod -
type -
sessionId -
Returns:

createEntityResultForSessionId

public EntityResult createEntityResultForSessionId(int sessionId)
Utility method for creating an EntityResult for the session identified by sessionId

. Basically this method creates an EntityResult and sets its compression threshold.

Parameters:
sessionId -
Returns:

createEntityResultForSessionId

public EntityResult createEntityResultForSessionId(int sessionId,
                                                   java.lang.String operationId)
Utility method for creating an EntityResult for the session identified by sessionId

. Basically this method creates an EntityResult and sets its compression threshold.

Also, this method sets the operationId of the EntityResult.

Parameters:
sessionId -
Returns:

generateRandomId

public static int generateRandomId()
Generates a negative random int.

Returns:
a negative int

parseStringValue

public static boolean parseStringValue(java.lang.String v,
                                       boolean defaultValue)
Parses the string value as a boolean.

If the string is 'yes' or 'true', then true is returned, and if is 'no' or 'false', false is returned.

Otherwise, defaultValue is returned.

Parameters:
v -
defaultValue -
Returns:

vectorToStringSeparateBySemicolon

public static java.lang.String vectorToStringSeparateBySemicolon(java.util.Vector list)
Generates a string containing the toString version of all the objects contained in the list list, separated by the ';' character

Parameters:
list -
Returns:
a String containing the representation of the vector or a empty String if list is empty

getEntityReference

public Entity getEntityReference(java.lang.String entityName)
                          throws java.lang.Exception
Returns a reference to an Entity with name entityName.

This method checks if locator for this entity is an instance of ServerReferenceLocator. If true, getEntityReferenceFromServer(String) is used instead getEntityReference(String)

Parameters:
entityName - the entityName
Returns:
a Entity reference of null if no entity exists with name entityName
Throws:
java.lang.Exception - if an error ocurrs

getEntityPrivilegedId

public static int getEntityPrivilegedId(Entity ent)
Gets the privileged identifier for the entity ent.

For this method to work, ent must be a PrivilegedSecurityEntity.

In this case, the privileged identifier is got from the Entity object. If it has not been set, a new privileged identifier is generated ramdomly and set in the Entity object. Then, this identifier is returned.

Parameters:
ent -
Returns:

truncateDateToMinutes

public static java.sql.Timestamp truncateDateToMinutes(java.util.Date date)
Sets the following fields of the object date to zero:

Calendar.MILLISECOND,Calendar.SECOND

The default calendar (for the default locale and timezone) is used.

Parameters:
date -
Returns:
a new Timestamp object with the same time as date except the fields set to zero.

truncateDataToHour_00_00_00

public static java.sql.Timestamp truncateDataToHour_00_00_00(java.util.Date date)
Sets the following fields of the object date to zero:

Calendar.MILLISECOND,Calendar.SECOND,Calendar.MINUTE,Calendar.HOUR_OF_DAY

The default calendar (for the default locale and timezone) is used.

Parameters:
date -
Returns:
a new Timestamp object with the same time as date except the fields set to zero.

getStringsOn

public static java.util.Vector getStringsOn(java.lang.String s,
                                            java.lang.String separator)
Parses the String s splitting it using separator as delimiter. A Vector of Strings is generated.

Parameters:
s - the String to parse. May be null. In this case, an empty Vector is returned
separator - the delimiter. May be null. In this case, a Vector with only the String s is returned
Returns:
a Vector with the resulting list of Strings

logUpdate

protected void logUpdate(java.util.Hashtable attributesValues,
                         java.util.Hashtable keysValues,
                         int sessionId)
Logs an update operation with keys-values keysValues and attributes-values attributesValues

The log is only performed if logUpdate is true.

Parameters:
attributesValues -
keysValues -
sessionId -

logToLogKeys

protected void logToLogKeys(java.lang.String s)
Logs the String s to the corresponding LogWriter. If logkeys field is null the LogManager.getDefaultLogWriter() is used to log, if not null.

If logkeys field is not null, for each of the logkeys, LogManager.getLogWriter(String) is used to log the String s

Parameters:
s -

processMultipleTableAttribute

protected java.util.Vector processMultipleTableAttribute(java.util.Vector list,
                                                         java.util.Vector processedMultipleAttributes)
Processes all the MultipleTableAttribute contained in the Vector list. All other objects are added to the resulting Vector with no changes. The MultipleTableAttribute objects are replaced by their attribute plus a list of ExtendedTableAttribute objects corresponding to the keys of the MultipleTableAttribute object.

Parameters:
list -
Returns:
a new Vector with the processed objects.

deleteMultipleTableAttributesColumns

protected EntityResult deleteMultipleTableAttributesColumns(EntityResult result,
                                                            java.util.Vector originalAttributes,
                                                            java.util.Vector processedMultipleAttributes)
Processes the EntityResult res creating TableMultipleValue objects .

Parameters:
result -
originalAttributes -
Returns:

processMultipleTableAttribute

protected java.util.Hashtable processMultipleTableAttribute(java.util.Hashtable av)
Processes all the MultipleTableAttribute contained as keys ih the Hashtable av. All other objects are added to the resulting Vector with no changes. The MultipleTableAttribute objects are replaced by their attribute.

Parameters:
av -
Returns:
a new Hashtable with the processed objects.

processFileColumnsAttributes

protected java.util.Hashtable processFileColumnsAttributes(java.util.Hashtable av)
Processes the Hashtable av using the fileInfoList information in this entity.

The DataFile objects contained in av are splitted in filename and file contents (bytes) as values in the resulting Hashtable and using the filename column and the file contents column as keys.

If fileInfoList is null in this entity, a clone of the Hashtable av is returned.

Parameters:
av -
Returns:
a new Hashtable with the processed objects

processFileColumnsAttributes

protected java.util.Vector processFileColumnsAttributes(java.util.Vector list)
Processes the Vector list using the information in fileInfoList.

For each object in list that has an associated FileInfo object, the FileInfo.getColumName() and FileInfo.getFileColumn() strings are added to the resulting Vector.

If fileInfoList is null in this entity, a clone of the Hashtable av is returned.

Parameters:
list - a Vectos with a list of attributes
Returns:
a new Vector with the processed objects

processFileResults

protected EntityResult processFileResults(EntityResult result)
Processes the result object using the information in fileInfoList.

For each FileInfo in fileInfoList, if the columns that correspond to filenames and to file contents are found in result, a new DataFile object is added to the result using as key the FileInfo object's key.

If fileInfoList is null in this entity, a clone of the Hashtable result is returned.

Parameters:
result -
Returns:
a new EntityResult with the processed objects

addEntityDataChangeListener

public void addEntityDataChangeListener(EntityDataChangeListener listener)
Registers a EntityDataChangeListener to this entity.

Specified by:
addEntityDataChangeListener in interface EntityDataChangeNotifier
Parameters:
listener -

removeEntityDataChangeListener

public void removeEntityDataChangeListener(EntityDataChangeListener listener)
Unregisters a EntityDataChangeListener to this entity.

Specified by:
removeEntityDataChangeListener in interface EntityDataChangeNotifier
Parameters:
listener -

fireDataChangeEvent

protected void fireDataChangeEvent(int type,
                                   java.util.Hashtable keysValues,
                                   java.util.Hashtable attributesValues)
Deprecated. Use fireDataChangeEvent(int, Hashtable, Hashtable, int)

Notifies all EntityDataChangeListener objects registered as listeners of this entity, with a new DataChangeEvent with the type, keysValues and attributesValues information.

If a registered listener is an instance of TransactionEntityDataChangeListener, then it is NOT notified.

Parameters:
type -
keysValues -
attributesValues -

fireDataChangeEvent

protected void fireDataChangeEvent(int type,
                                   java.util.Hashtable keysValues,
                                   java.util.Hashtable attributesValues,
                                   int sessionId)
Notifies all EntityDataChangeListener objects registered as listeners of this entity, with a new DataChangeEvent with the type, keysValues and attributesValues information.

If a registered listener is an instance of TransactionEntityDataChangeListener, then it is NOT notified.

Parameters:
type -
keysValues -
attributesValues -
sessionId - identifier of the sessionId of the user that executes the operation

fireTransactionDataChangeEvent

protected void fireTransactionDataChangeEvent(int type,
                                              java.util.Hashtable kv,
                                              java.util.Hashtable av,
                                              java.sql.Connection con)
Deprecated. Use fireTransactionDataChangeEvent(int, Hashtable, Hashtable, int, Connection)

Notifies all TransactionEntityDataChangeListener objects registered as listeners of this entity, with a new DataChangeEvent with the type, keysValues and attributesValues information. The Connection con is provided to the listener.

If a registered listener is NOT an instance of TransactionEntityDataChangeListener, then it is NOT notified.

Parameters:
type -
kv -
av -
con -

fireTransactionDataChangeEvent

protected void fireTransactionDataChangeEvent(int type,
                                              java.util.Hashtable kv,
                                              java.util.Hashtable av,
                                              int sessionId,
                                              java.sql.Connection con)
Notifies all TransactionEntityDataChangeListener objects registered as listeners of this entity, with a new DataChangeEvent with the type, keysValues and attributesValues information. The Connection con is provided to the listener.

If a registered listener is NOT an instance of TransactionEntityDataChangeListener, then it is NOT notified.

Parameters:
type -
kv -
av -
sessionId -
con -

query

public EntityResult query(java.util.Hashtable keysValues,
                          java.util.Vector attributes,
                          int sessionId,
                          java.sql.Connection con)
                   throws java.lang.Exception
Executes a query operation using the provided Connection, with the conditions and attributes required.

This method calls query(Hashtable, Vector, int, Connection, Vector, boolean) using null and true as the last two parameters.

Specified by:
query in interface TransactionalEntity
Parameters:
keysValues -
attributes -
sessionId -
con -
Returns:
Throws:
java.lang.Exception - if an error ocurrs

query

public EntityResult query(java.util.Hashtable keysValues,
                          java.util.Vector attributes,
                          int sessionId,
                          java.sql.Connection con,
                          java.util.Vector orderColumns,
                          boolean ascending)
                   throws java.lang.Exception
Executes a query using the provided connection.

The keysValues object determines the conditions that the records must fulfill, that is, the WHERE clause.

The attributes object determines the columns for each record that must be returned, that is, the asked columns.

The sessionId number identifies the session.

The orderColumns object determines the order columns, that is, the columns to use in the ORDER BY clause.

The ascending boolean determines if the order is ascending or descending.

When overriding, this method must suppose that the connection provided is not in autocommit mode, so all operations are executed in a transaction. This means that in an error ocurrs this method should throw an Exception to ensure that the calling method is properly notified.

The following methods of this class are called:

Parameters:
keysValues - the conditions. The key-value pairs will be interpreted as column-value conditions.
attributes - if empty, all columns will be returned
sessionId - the caller session identifier. Use privileged identifier for bypassing restrictions.
con - the connection to use when executing the query
orderColumns - the order columns. Can be null.
ascending - the ascending/descending order
Returns:
the query result. Will be empty if no records fulfill the conditions.
Throws:
java.lang.Exception - if an error ocurrs or the caller has not permission to execute the action.

insert

public EntityResult insert(java.util.Hashtable attributesValues,
                           int sessionId,
                           java.sql.Connection con)
                    throws java.lang.Exception
Executes an insert operation with the provided Connection.

The attributesValues object determines the columns and values that will be inserted.

The sessionId number identifies the session.

When overriding, this method must suppose that the connection provided is not in autocommit mode, so all operations are executed in a transaction. This means that in an error ocurrs this method should throw an Exception to ensure that the calling method is properly notified.

The following methods of this class are called:

If no valid attributes-values are contained in attributesValues no insert is performed and no error is produced.

If there is no error, a TransactionDataChangeEvent is fired and all listeners are notified.

Specified by:
insert in interface TransactionalEntity
Parameters:
attributesValues - the table columns and corresponding values to insert
sessionId - the session identifier
con - the Connection to use when executing the PreparedStatement
Returns:
an EntityResult. This result will contain the autonumerical as a key-value pair, where the key is the autonumerical column and the value the autonumerical value
Throws:
java.lang.Exception - if an error ocurrs or the caller has not permission to execute the action.

insertAutonumericalAlias

protected EntityResult insertAutonumericalAlias(EntityResult res)
Inserts the autonumerical column alias and the autonumerical value as key-value into the EntityResult res.

This is only done if the autonumericalColumn for this entity is not null and res contains a pair key-value where key is the autonumerical column and the value is an Integer.

Parameters:
res -
Returns:
the res object with a new key-value pair if the conditions above are met

update

public EntityResult update(java.util.Hashtable attributesValues,
                           java.util.Hashtable keysValues,
                           int sessionId,
                           java.sql.Connection con)
                    throws java.lang.Exception
Executes an update operation with the provided Connection.

The attributesValues object determines the columns that will be updated and to which values.

The keysValues object determines the conditions that the records that will be updated must fulfill, that is, the WHERE clause.

The sessionId number identifies the session.

When overriding, this method must suppose that the connection provided is not in autocommit mode, so all operations are executed in a transaction. This means that in an error ocurrs this method should throw an Exception to ensure that the calling method is properly notified.

The following methods of this class are called:

If no valid attributes-values are contained in attributesValues no update is performed and no error is produced.

If there is no error, a TransactionDataChangeEvent is fired and all listeners are notified.

Specified by:
update in interface TransactionalEntity
Parameters:
keysValues - the table columns and corresponding values to use as conditions that the records to be updated must fulfill
attributesValues - the table columns and corresponding values to insert
sessionId - the session identifier
con - the Connection to use when executing the PreparedStatement
Returns:
an EntityResult This result is empty in the standard implementation.
Throws:
java.lang.Exception - if an error ocurrs or the caller has not permission to execute the action.

delete

public EntityResult delete(java.util.Hashtable keysValues,
                           int sessionId,
                           java.sql.Connection con)
                    throws java.lang.Exception
Executes a delete operation with the provided Connection.

The keysValues object determines the conditions that the records that will be deleted must fulfill, that is, the WHERE clause.

The sessionId number identifies the session.

When overriding, this method must suppose that the connection provided is not in autocommit mode, so all operations are executed in a transaction. This means that in an error ocurrs this method should throw an Exception to ensure that the calling method is properly notified.

The following methods of this class are called:

If no valid keys-values are contained in keysValues no delete is performed and no error is produced.

If the records to be deleted have attachments, these attachments will also be deleted. If these attachments are stored on the file system, a query is performed with keysValues to determine which files must be deleted.

If there is no error, a TransactionDataChangeEvent is fired and all listeners are notified.

Specified by:
delete in interface TransactionalEntity
Parameters:
keysValues - the table columns and corresponding values to use as conditions that the records to be deleted must fulfill
sessionId - the session identifier
con - the Connection to use when executing the PreparedStatement
Returns:
an EntityResult This result is empty in the standard implementation.
Throws:
java.lang.Exception - if an error ocurrs or the caller has not permission to execute the action.

preInsert

protected void preInsert(java.util.Hashtable attributesValues,
                         int sessionId,
                         java.sql.Connection con)
                  throws java.lang.Exception
Throws:
java.lang.Exception

postInsert

protected void postInsert(EntityResult insertResult,
                          java.util.Hashtable attributesValues,
                          int sessionId,
                          java.sql.Connection con)
                   throws java.lang.Exception
Throws:
java.lang.Exception

preUpdate

public void preUpdate(java.util.Hashtable attributesValues,
                      java.util.Hashtable keysValues,
                      int sessionId,
                      java.sql.Connection con)
               throws java.lang.Exception
Throws:
java.lang.Exception

postUpdate

public void postUpdate(EntityResult updateResult,
                       java.util.Hashtable attributesValues,
                       java.util.Hashtable keysValues,
                       int sessionId,
                       java.sql.Connection con)
                throws java.lang.Exception
Throws:
java.lang.Exception

preDelete

public void preDelete(java.util.Hashtable keysValues,
                      int sessionId,
                      java.sql.Connection con)
               throws java.lang.Exception
Throws:
java.lang.Exception

postDelete

public void postDelete(EntityResult deleteResult,
                       java.util.Hashtable keysValues,
                       int sessionId,
                       java.sql.Connection con)
                throws java.lang.Exception
Throws:
java.lang.Exception

getWildCardColumns

public java.util.Vector getWildCardColumns()
Returns the list of columns (by name) which are allowed to use LIKE conditions in queries

Returns:
a Vector with the column names or null if have not been defined

getUpdateColumns

public java.util.Vector getUpdateColumns()
Returns the list of columns (by name) that can be updated in update operations

Returns:
a Vector with the column names or null if have not been defined

getOrderColumns

public java.util.Vector getOrderColumns()
Returns the list of columns (by name) to use in ORDER BY clause

Returns:
a Vector with the column names or null if have not been defined

getDescOrderColumns

public java.util.Vector getDescOrderColumns()
Returns the list of columns (by name) to use in ORDER BY DESC clause

Returns:
a Vector with the column names or null if have not been defined

getColumns

public java.util.Vector getColumns()
Returns the list of columns (by name) that may be used in operations in this entity.

Returns:
a Vector with the column names or null if have not been defined

getAutonumericalColumn

public java.lang.String getAutonumericalColumn()
Returns the autonumerical column name or null if nof defined

Returns:

executeStatement

protected EntityResult executeStatement(java.lang.String sqlSentence,
                                        java.sql.Connection con)
                                 throws java.lang.Exception
Executes the query defined by the SQL sentence sqlSentence using the connection con

Parameters:
sqlSentence - the sentence to execute
con - the connection to use
Returns:
a new EntityResult with data if the operation produces data or empty if does not produce data
Throws:
java.lang.Exception - if an error ocurrs

getSQLTypesFromMetaData

protected java.util.Map getSQLTypesFromMetaData(java.util.List columns,
                                                int sessionId)
Obtains the DB Column metadata

Parameters:
columns -
sessionId -
Returns:
Map

getColumnListForAvancedQuery

public java.util.Map getColumnListForAvancedQuery(int sessionId)
                                           throws java.lang.Exception
Returns a map structure with the columns and sql types of this entity's table.

Specified by:
getColumnListForAvancedQuery in interface AdvancedQueryEntity
Parameters:
sessionId - the session identifier
Returns:
the mapping of columns and types
Throws:
java.lang.Exception

getSubGroupValues

public java.util.Hashtable getSubGroupValues(java.util.Hashtable fieldsValues,
                                             java.util.Vector columns)
Deprecated. @see getSubGroupValues(Hashtable, Vector, int)

Creates a hashtable with the keys-values contained in fieldsValues that satisfy the condition that key is contained in columns.

Parameters:
fieldsValues -
columns -
Returns:
the new hashtable

getSubGroupValues

public java.util.Hashtable getSubGroupValues(java.util.Hashtable fieldsValues,
                                             java.util.Vector columns,
                                             int sessionid)
Creates a hashtable with the keys-values contained in fieldsValues that satisfy the condition that key is contained in columns.

Parameters:
fieldsValues -
columns -
sessionid -
Returns:

processingMultipleValueAttributes

public static java.util.Hashtable processingMultipleValueAttributes(java.util.Hashtable keysValues)
Processes the MultipleValue objects contained in keysValues. Returns a new Hashtable with the same data as keysValues except that MultipleValue objects are deleted and the key-value pairs of these objects are added to the new Hashtable.

Parameters:
keysValues -
Returns:
a new Hashtable with MultipleValue objects replaced by their key-value pairs

deleteAttachmentFile

public boolean deleteAttachmentFile(java.util.Hashtable keysValues,
                                    int sessionId)
                             throws java.lang.Exception
This method calls deleteAttachmentFile(Hashtable, int, Connection)

Specified by:
deleteAttachmentFile in interface FileManagementEntity
Parameters:
keysValues -
sessionId -
Throws:
java.lang.Exception

deleteAttachmentFile

public boolean deleteAttachmentFile(java.util.Hashtable kv,
                                    int sessionId,
                                    java.sql.Connection con)
                             throws java.lang.Exception
If attachmentFilePath is not null, this method executes a query with conditions keysValues and then if one record is found, searchs the column named attachmentFileNameColumn and uses the file name found to delete the file in the file system.

This method requires grants for UPDATE_ACTION to session sessionId

If more than one record is found an Exception is thrown.

After deleting the file, the following fields (if exist) of the database table are set to null:

attachmentFileNameColumn,originalAttachmentFileNameColumn,descriptionAttachmentFileColumn,attachmentFileSizeColumn

Parameters:
kv - the conditions that identify the record for which the attachment must be deleted
sessionId - the session identifier
con - the connection to use for executing queries
Returns:
true if a file has been deleted or false otherwise
Throws:
java.lang.Exception - if an error ocurrs

processMultipleAttributeKey

public java.util.Vector processMultipleAttributeKey(java.util.Vector list)
Processes MultipleReferenceDataFieldAttribute objects contained in list.

For each MultipleReferenceDataFieldAttribute found, the objects in MultipleReferenceDataFieldAttribute.getCods() are added to the resulting Vector

Parameters:
list -
Returns:
the processed list as a new Vector

getAttachmentFilePath

protected java.lang.String getAttachmentFilePath(java.util.Hashtable kv,
                                                 int sessionId)
                                          throws java.lang.Exception
Throws:
java.lang.Exception

getAttachmentFilePath

protected java.lang.String getAttachmentFilePath(java.util.Hashtable kv,
                                                 int sessionId,
                                                 java.sql.Connection con)
                                          throws java.lang.Exception
Throws:
java.lang.Exception

setName

public void setName(java.lang.String name)
Specified by:
setName in interface IdentifiedEntity

getDatabaseConnectionManager

public DatabaseConnectionManager getDatabaseConnectionManager()

checkOrderColumns

protected java.util.Vector checkOrderColumns(java.util.Vector order)

Ontimize