public class DefaultTableEntity extends TableEntity
TableEntity.AttachmentReceiving, TableEntity.FileInfo, TableEntity.FileInfoList, TableEntity.Receiving| Modifier and Type | Field and Description |
|---|---|
protected String |
props |
alias, aliasPropertiesParser, aliasReverse, ASTERISK, ATTACHMENT_FILE_DESCRIPTION_COLUMN, ATTACHMENT_FILE_NAME_COLUMN, ATTACHMENT_FILE_NAME_KEYS, ATTACHMENT_FILE_ORIGINAL_NAME_COLUMN, ATTACHMENT_FILE_ORIGINAL_PATH_COLUMN, ATTACHMENT_FILE_PATH, ATTACHMENT_FILE_SIZE_COLUMN, ATTACHMENT_SEPARATOR, ATTACHMENT_TABLE, attachmentFileNameColumn, attachmentFileNameKeys, attachmentFilePath, attachmentFileSizeColumn, attachTable, auditorLog, AUTOCONFIGURATION, AUTONUMERICAL, autonumericalColumn, calendar, checkOperationResult, columnNames, COLUMNS, connectionRequestTime, COUNT_COLUMNS, countColumns, dataChangeListeners, dBLocalErrorMessage, defaultEntityScriptManagerClassName, DELETE_ACTION, DELETE_KEYS, deleteKeys, descendantColumnsOrder, descriptionAttachmentFileColumn, enableScripting, entitiesPropertiesParser, entitiesTableAttribute, entityName, entityScripting, FETCH_SIZE, fetchSize, FILE_COLUMNS, fileInfoList, FORCE_DISTINCT, forceDistinct, GENERATED_KEY, generatedKeyList, hOtherLocaleTablesColumns, hOtherLocaleTablesKey, INSERT_ACTION, INSERT_AUTOMATICLY_ATTACHMENT, INSERT_COLUMNS, INSERT_KEYS, insertAttachmentAutomatically, insertColumn, insertKeys, INTERROG, keys, KEYS, LIMIT_QUERY_OTHERS_ENTITIES, limitQueryOthersEntities, LOCALE_COLUMNS, LOCALE_TABLE, localeTable, locator, LOG_KEYS, logDelete, logInsert, logkeys, logQuery, logUpdate, M_ERROR_OPERATION, M_IT_HAS_NOT_CHANGED_ANY_RECORD, M_LICENSE_PERMISSION_ERROR, M_TEMPORALY_RESTRICTED_BY_PERMISSION_ACTION, M_YOU_DO_NOT_HAVE_PERMISSION_TO_EXECUTE_ACTION, manager, maxConnectionWaitTime, oneToOneMode, orderColumns, originalAttachmentFileNameColumn, originalAttachmentFilePathColumn, OTHER_ENTITIES, OTHER_LOCALE_TABLES, OTHER_LOCALE_TABLES_COLUMNS, OTHER_LOCALE_TABLES_KEY, othersEntities, PERCENT, PRINCIPAL_COLUMNS, PRINCIPAL_KEYS, PRINCIPAL_TABLE, principalColumnNames, principalKeyName, principalTable, privilegedId, properties, propertiesPath, QUERY_ACTION, QUERY_TABLE, queryTable, receivedAttachmentFile, receivedTempFiles, RECORD_OPERATIONS, registeredDispatcher, REPORT_ADVANCED_QUERY_COLUMNS, REPORT_ADVANCED_QUERY_TYPES, reportAvancedQueryColumns, reportAvancedQueryTypes, SECONDARY_COLUMNS, SECONDARY_KEYS, SECONDARY_TABLE, secondaryColumnsNames, secondaryKeyName, secondaryTable, sendAttachmentFile, SORT, SORT_DESC, table, TABLE, TABLE_ATTRIBUTE_ENTITIES, tempFiles, TRUNCATE_DATE_DEFAULT_VALUE, TRUNCATE_DATES, truncateDates, UNDERSCORE, UPDATE_ACTION, UPDATE_COLUMNS, UPDATE_KEYS, updateColumn, updateKeys, USE_SETSTRING_LONG_STRINGS, useAlwaysTableAttributeEntities, vLocaleColumns, vOtherLocaleTables, WILDCARD_COLUMNS, wildcardColumnsref| Constructor and Description |
|---|
DefaultTableEntity(EntityReferenceLocator locator,
DatabaseConnectionManager dbConnectionManager,
int port,
Properties prop,
Properties aliasProp) |
DefaultTableEntity(EntityReferenceLocator locator,
DatabaseConnectionManager dbManager,
int port,
String properties) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
getExtendedAliasPropertiesName()
Gets the extended alias property file path.
|
protected String |
getExtendedPropertiesName()
Gets the extended property file path.
|
void |
loadAliasFile()
Loads the alias properties.
|
void |
readProperties()
Loads the properties file for this entity.
|
void |
setName(String name) |
addEntityDataChangeListener, buildConditionsString, cancelReceiving, checkAmbiguousColumns, checkAvailableLocaleTables, checkBasicExpresionLocalesInKv, checkBasicExpresionLocalesInKv, checkConditionsWithTablePreffix, checkDeleteKeys, checkFinishedSession, checkInsertKeys, checkLocalesInKV, checkOrderColumns, checkOtherLocaleTables, checkPermissions, checkUpdateKeys, configureReverseAlias, connect, connect, createAdvancedEntityResultForSessionId, createAdvancedEntityResultForSessionId, createEntityResultForSessionId, createEntityResultForSessionId, createEntityResultForSessionId, createEntityResultForSessionId, createEntityResultForSessionId, createEntityScriptManager, delete, delete, deleteAttachmentFile, deleteAttachmentFile, deleteHOtherLocaleTablesAlias, deleteLocaleColumns, deleteMultipleTableAttributesColumns, disconnect, disconnect, dispatcherAttribute, executePreparedStatement, executePreparedStatement, executePreparedStatement, executePreparedStatement, executePreparedStatement, executePreparedStatement, executePreparedStatement, executeStatement, filterAttributes, filterKeys, finishReceiving, fireDataChangeEvent, fireDataChangeEvent, fireTransactionDataChangeEvent, fireTransactionDataChangeEvent, generatedKeysToEntityResult, generateRandomId, getActions, getAliasForColumn, getAttachmentFileNameForKeys, getAttachmentFilePath, getAttachmentFilePath, getAutonumericalColumn, getBaseEntityName, getBytes, getColumnForAlias, getColumnListForAvancedQuery, getColumns, getColumnsWithoutLocale, getConditionsWithTablePreffix, getContidionsWithoutFilterKeys, getDatabaseConnectionManager, getDeleteKeys, getDescOrderColumns, getDescription, getEntityPrivilegedId, getEntityReference, getErrorMessage, getExtension, gethOtherLocaleTablesColumns, getInsertKeys, getJoinConditions, getKeys, getKeysVector, getLocaleColumnsFromTable, getLocaleIdFromSession, getLocaleTableName, getLocaleTableName, getMetadata, getName, getOrderColumns, getPrivilegedId, getPropertiesPath, getQueryRecordNumber, getQueryRecordNumber, getQueryTable, getSchemaQueryTable, getSchemaTable, getSecondaryColumnsWithoutKey, getSize, getSQLTypesFromMetaData, getStringsOn, getSubGroupValues, getSubGroupValues, getTable, getTypeFromMetadata, getUpdateColumns, getUpdateKeys, getUser, getValidAttributes, getValidDeletingKeysValues, getValidInsertingAttributesValues, getValidQueryingKeysValues, getValidUpdatingAttributesValues, getValidUpdatingKeysValues, getvLocaleColumns, getWildCardColumns, insert, insert, insertAutonumericalAlias, insertInLocaleTableLocaleColumns, insertInLocaleTablesForOneToOne, insertLocaleColumn, insertOtherEntities, isBinaryType, loadAliasFile, logToLogKeys, logUpdate, modifyBexpWithOtherLocaleTableAlias, modifyBexpWithOtherLocaleTableAlias, parseProperties, parseStringValue, particularizeConditions, performExtendedAliasProperties, performExtendedProperties, postDelete, postInsert, postUpdate, preDelete, preInsert, prepareToReceive, prepareToReceive, prepareToReceive, prepareToTransfer, prepareToTransfer, preUpdate, processColumnsWithoutLocale, processFileColumnsAttributes, processFileColumnsAttributes, processFileResults, processingMultipleValueAttributes, processingReferenceDataFieldAttributes, processingReferenceDataFieldAttributes, processMultipleAttributeKey, processMultipleTableAttribute, processMultipleTableAttribute, processOtherEntities, processValidLocaleColumnsValues, putBytes, query, query, query, query, query, queryOtherEntities, readProperties, readProperties, registerAttributeDispatcher, reloadScripts, removeEntityDataChangeListener, replaceAliasByColumn, replaceAliasByColumn, replaceAliasByColumn, replaceAliasByColumn, replaceAliasByColumn, replaceColumnByAlias, replaceColumnByAlias, replaceColumnByAlias, replaceColumnByAlias, replaceColumnByAliasKeepColumns, resultSetToEntityResult, resultSetToEntityResult, resultSetToEntityResult, retrieveDataToInsert, setLimitQueryOthersEntities, setObject, setObject, setPrivilegedId, tagAttributes, tagAttributesWithoutAlias, tagKeysValues, toVectorOfBooleans, truncateDataToHour_00_00_00, truncateDateToMinutes, update, update, updateAttachmentValues, updateInLocaleTablesForOneToOne, updateLocaleColumns, vectorToStringSeparateBySemicolonclone, exportObject, exportObject, exportObject, unexportObjectgetClientHost, getLog, setLogprotected String props
public DefaultTableEntity(EntityReferenceLocator locator, DatabaseConnectionManager dbManager, int port, String properties) throws Exception
Exceptionpublic DefaultTableEntity(EntityReferenceLocator locator, DatabaseConnectionManager dbConnectionManager, int port, Properties prop, Properties aliasProp) throws Exception
Exceptionpublic void readProperties()
throws Exception
TableEntitypropertiesPath (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 |
| CountColumns | Columns of the table specified to apply sql count operations over the
data. This parameter improves performance to determine total record count
in limited queries (e.g Table component when is paged). When not
specified, operation will be count(*) since 5.2080EN |
no |
| 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 |
| GeneratedKey | Autogenetared columns by database when insert operations are performed. | no |
| WildcardColumns | Columns in which 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 |
Deprecated since 5.2056EN-0.2 (See Sort). 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
TableEntity.readProperties(String) with the standard location for this
entity's properties file.
readProperties in class TableEntityExceptionpublic void loadAliasFile()
TableEntityloadAliasFile in class TableEntityprotected String getExtendedAliasPropertiesName()
TableEntitygetExtendedAliasPropertiesName in class TableEntityString with the file path.protected String getExtendedPropertiesName()
TableEntitygetExtendedPropertiesName in class TableEntityString with the file path.public void setName(String name)
setName in interface IdentifiedEntitysetName in class TableEntityCopyright © 2016 Imatia Innovation S.L.. All rights reserved.