primaryKeyArguments
This method handles UUID values as a pair of
Long arguments for the most and least significant bits. All other
keys are returned as a single argument list as-is.
- Parameters:
id- the primary key- Returns:
- the arguments
net.solarnetwork.dao.GenericDao<T,K> , JdbcDao, org.springframework.beans.factory.InitializingBeanBaseJdbcBatchableDao, JdbcSecurityTokenDaoGenericDao for SolarNode using JDBC.net.solarnetwork.dao.GenericDao.EntityEventType, net.solarnetwork.dao.GenericDao.StandardSortKeystatic final StringinitSqlResource.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringsqlGetTablesVersion property.static final Stringstatic final Stringstatic final Stringprotected static final CalendarlogloggerENTITY_EVENT_ENTITY_ID_PROPERTY, ENTITY_EVENT_ENTITY_PROPERTY, ENTITY_EVENT_TOPIC_TEMPLATE, SORT_BY_CREATED_ASCENDING, SORT_BY_CREATED_DESCENDING, SORT_BY_CREATED_ID_ASCENDING, SORT_BY_CREATED_ID_DESCENDING, SORT_BY_ID_ASCENDING, SORT_BY_ID_DESCENDINGBaseJdbcGenericDao(Class<? extends T> objectType,
Class<? extends K> keyType,
org.springframework.jdbc.core.RowMapper<T> rowMapper) BaseJdbcGenericDao(Class<? extends T> objectType,
Class<? extends K> keyType,
org.springframework.jdbc.core.RowMapper<T> rowMapper,
String tableNameTemplate,
String entityName,
int version) static StringapplySqlOrderClauses(String sql,
List<String> orderClauses) voidprotected Tstatic InstantgetInstantColumn(ResultSet rs,
int columnIndex) Instant from a timestamp result set column.protected org.springframework.jdbc.core.RowMapper<T>static UUIDgetUuidColumns(ResultSet rs,
int columnIndex) UUID from a pair of long result set columns.protected voidpostEntityEvent(K id,
T entity,
net.solarnetwork.dao.GenericDao.EntityEventType eventType) protected Object[]primaryKeyArguments(K id) protected Stringstatic voidsetInstantParameter(PreparedStatement stmt,
int parameterIndex,
Instant time) Instant as a timestamp statement parameter.static voidsetUuidParameters(PreparedStatement stmt,
int parameterIndex,
UUID uuid) UUID as a pair of long statement parameters.static StringsqlOrderClause(String columnName,
boolean descending) sqlOrderClauses(String classPathResource,
List<net.solarnetwork.domain.SortDescriptor> sorts) getBatchSqlResource, getEventAdmin, getInitSqlResource, getMessageSource, getSchemaName, getSqlForUpdateSuffix, getSqlGetTablesVersion, getSqlResource, getSqlResource, getSqlResourcePrefix, getTableName, getTableNames, getTablesVersion, init, insertDomainObject, isUseAutogeneratedKeys, postEvent, schemaExists, setEventAdmin, setInitSqlResource, setMessageSource, setSchemaName, setSqlForUpdateSuffix, setSqlGetTablesVersion, setSqlResourcePrefix, setStoreStatementValues, setTableName, setTablesVersion, setUpdateStatementValues, setUseAutogeneratedKeys, storeDomainObject, storeDomainObjectWithoutAutogeneratedKeys, tableExists, updateDomainObject, upgradeTablesVersion, verifyDatabaseExistscheckDaoConfig, createJdbcTemplate, getConnection, getDataSource, getExceptionTranslator, getJdbcTemplate, initTemplateConfig, releaseConnection, setDataSource, setJdbcTemplateafterPropertiesSet, initDaoclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitentityEventTopicderby-N.sqlGetTablesVersion property. The
AbstractJdbcDao.getTableName() value is used in the pattern, e.g.
T-init.sql.initSqlResource.
The AbstractJdbcDao.getSqlResourcePrefix() value is used in the pattern, e.g.
R-init.sql.objectType - the entity typekeyType - the key typerowMapper - a mapper to use when mapping entity query result rows to entity
objectsIllegalArgumentException - if any parameter is nullobjectType - the entity typekeyType - the key typerowMapper - a mapper to use when mapping entity query result rows to entity
objectstableNameTemplate - a template with a %s parameter for the SQL table nameentityName - The entity name to use. This name forms the basis of the default
SQL resource prefix, table name, tables version query, and SQL
init resource.version - the tables version, to manage DDL migrations
The AbstractJdbcDao.getEventAdmin() service must be available for the event to
be posted.
id - the entity IDentity - the optional entityeventType - the type of event
The getRowMapper() will be used to map the results.
sql - the SQL to executeparameters - the optional parameters
This method handles UUID values as a pair of
Long arguments for the most and least significant bits. All other
keys are returned as a single argument list as-is.
id - the primary key
This method will call sqlOrderClauses(String, List) and if that
returns any values, applySqlOrderClauses(String, List).
classPathResource - the base SQL resource to loadsorts - the sorts to applyThe returned array should contain just the clause values, like my_id DESC.
This method handles the sort keys defined in GenericDao.StandardSortKey by
generating order clauses that are named after the enumeration values
themselves. Extending classes can override this method to support more
keys, or override this behaviour.
classPathResource - the SQL resource the order clauses is to be applied tosorts - the sort descriptors
This method looks for the last ORDER BY in sql, and
replaces it with a newly generated order clause derived from the
orderClauses list. If no ORDER BY is found, it will be
appended along with the generated order clause.
sql - the SQLorderClauses - the order clauses, as returned from
sqlOrderClause(String, boolean)columnName - the column namedescending - true for descending order, false for
ascendingInstant as a timestamp statement parameter.stmt - the statementparameterIndex - the statement parameter index to settime - the time to setSQLException - if any SQL error occursInstant from a timestamp result set column.rs - the result setcolumnIndex - the column indexSQLException - if any SQL error occursUUID as a pair of long statement parameters.stmt - the statementparameterIndex - the statement parameter index to set the UUID upper bits; the
lower bits will be set on parameter parameterIndex + 1uuid - the UUID to setSQLException - if any SQL error occursUUID from a pair of long result set columns.rs - the result setcolumnIndex - the column index of the UUID upper bits; the lower bits will be
read from column columnIndex + 1SQLException - if any SQL error occurs