类的使用
org.springframework.dao.DataAccessException
使用DataAccessException的程序包 程序包 说明 org.springframework.dao Exception hierarchy enabling sophisticated error handling independent of the data access approach in use.org.springframework.dao.support Support classes for DAO implementations, providing miscellaneous utility methods.org.springframework.jca.cci This package contains Spring's support for the Common Client Interface (CCI), as defined by the J2EE Connector Architecture.org.springframework.jca.cci.core Provides the core JCA CCI support, based on CciTemplate and its associated callback interfaces.org.springframework.jca.cci.object The classes in this package represent EIS operations as threadsafe, reusable objects.org.springframework.jdbc The classes in this package make JDBC easier to use and reduce the likelihood of common errors.org.springframework.jdbc.core Provides the core JDBC framework, based on JdbcTemplate and its associated callback interfaces and helper objects.org.springframework.jdbc.core.namedparam JdbcTemplate variant with named parameter support.org.springframework.jdbc.core.support Classes supporting theorg.springframework.jdbc.corepackage.org.springframework.jdbc.datasource.init Provides extensible support for initializing databases through scripts.org.springframework.jdbc.datasource.lookup Provides a strategy for looking up JDBC DataSources by name.org.springframework.jdbc.object The classes in this package represent RDBMS queries, updates, and stored procedures as threadsafe, reusable objects.org.springframework.jdbc.support Support classes for the JDBC framework, used by the classes in the jdbc.core and jdbc.object packages.org.springframework.jdbc.support.incrementer Provides a support framework for incrementing database table values via sequences, with implementations for various databases.org.springframework.jdbc.support.xml Abstraction for handling fields of SQLXML data type.org.springframework.orm Root package for Spring's O/R Mapping integration classes.org.springframework.orm.hibernate5 Package providing integration of Hibernate 5.x with Spring concepts.org.springframework.orm.hibernate5.support Classes supporting theorg.springframework.orm.hibernate5package.org.springframework.orm.jpa Package providing integration of JPA (Java Persistence API) with Spring concepts.org.springframework.orm.jpa.support Classes supporting theorg.springframework.orm.jpapackage.org.springframework.orm.jpa.vendor Support classes for adapting to specific JPA vendors.org.springframework.test.context.junit4 Support classes for integrating the Spring TestContext Framework with JUnit 4.12 or higher.org.springframework.test.context.testng Support classes for integrating the Spring TestContext Framework with TestNG.org.springframework.dao中DataAccessException的使用
org.springframework.dao中DataAccessException的子类 修饰符和类型 类 说明 classCannotAcquireLockExceptionException thrown on failure to acquire a lock during an update, for example during a "select for update" statement.classCannotSerializeTransactionExceptionException thrown on failure to complete a transaction in serialized mode due to update conflicts.classCleanupFailureDataAccessExceptionException thrown when we couldn't cleanup after a data access operation, but the actual operation went OK.classConcurrencyFailureExceptionException thrown on concurrency failure.classDataAccessResourceFailureExceptionData access exception thrown when a resource fails completely: for example, if we can't connect to a database using JDBC.classDataIntegrityViolationExceptionException thrown when an attempt to insert or update data results in violation of an integrity constraint.classDataRetrievalFailureExceptionException thrown if certain expected data could not be retrieved, e.g.classDeadlockLoserDataAccessExceptionGeneric exception thrown when the current process was a deadlock loser, and its transaction rolled back.classDuplicateKeyExceptionException thrown when an attempt to insert or update data results in violation of an primary key or unique constraint.classEmptyResultDataAccessExceptionData access exception thrown when a result was expected to have at least one row (or element) but zero rows (or elements) were actually returned.classIncorrectResultSizeDataAccessExceptionData access exception thrown when a result was not of the expected size, for example when expecting a single row but getting 0 or more than 1 rows.classIncorrectUpdateSemanticsDataAccessExceptionData access exception thrown when something unintended appears to have happened with an update, but the transaction hasn't already been rolled back.classInvalidDataAccessApiUsageExceptionException thrown on incorrect usage of the API, such as failing to "compile" a query object that needed compilation before execution.classInvalidDataAccessResourceUsageExceptionRoot for exceptions thrown when we use a data access resource incorrectly.classNonTransientDataAccessExceptionRoot of the hierarchy of data access exceptions that are considered non-transient - where a retry of the same operation would fail unless the cause of the Exception is corrected.classNonTransientDataAccessResourceExceptionData access exception thrown when a resource fails completely and the failure is permanent.classOptimisticLockingFailureExceptionException thrown on an optimistic locking violation.classPermissionDeniedDataAccessExceptionException thrown when the underlying resource denied a permission to access a specific element, such as a specific database table.classPessimisticLockingFailureExceptionException thrown on a pessimistic locking violation.classQueryTimeoutExceptionException to be thrown on a query timeout.classRecoverableDataAccessExceptionData access exception thrown when a previously failed operation might be able to succeed if the application performs some recovery steps and retries the entire transaction or in the case of a distributed transaction, the transaction branch.classTransientDataAccessExceptionRoot of the hierarchy of data access exceptions that are considered transient - where a previously failed operation might be able to succeed when the operation is retried without any intervention by application-level functionality.classTransientDataAccessResourceExceptionData access exception thrown when a resource fails temporarily and the operation can be retried.classTypeMismatchDataAccessExceptionException thrown on mismatch between Java type and database type: for example on an attempt to set an object of the wrong type in an RDBMS column.classUncategorizedDataAccessExceptionNormal superclass when we can't distinguish anything more specific than "something went wrong with the underlying resource": for example, an SQLException from JDBC we can't pinpoint more precisely.org.springframework.dao.support中DataAccessException的使用
返回DataAccessException的org.springframework.dao.support中的方法 修饰符和类型 方法 说明 DataAccessExceptionChainedPersistenceExceptionTranslator. translateExceptionIfPossible(RuntimeException ex)DataAccessExceptionPersistenceExceptionTranslator. translateExceptionIfPossible(RuntimeException ex)Translate the given runtime exception thrown by a persistence framework to a corresponding exception from Spring's genericDataAccessExceptionhierarchy, if possible.org.springframework.jca.cci中DataAccessException的使用
org.springframework.jca.cci中DataAccessException的子类 修饰符和类型 类 说明 classCannotCreateRecordExceptionException thrown when the creating of a CCI Record failed for connector-internal reasons.classCannotGetCciConnectionExceptionFatal exception thrown when we can't connect to an EIS using CCI.classCciOperationNotSupportedExceptionException thrown when the connector doesn't support a specific CCI operation.classInvalidResultSetAccessExceptionException thrown when a ResultSet has been accessed in an invalid fashion.classRecordTypeNotSupportedExceptionException thrown when the creating of a CCI Record failed because the connector doesn't support the desired CCI Record type.org.springframework.jca.cci.core中DataAccessException的使用
抛出DataAccessException的org.springframework.jca.cci.core中的方法 修饰符和类型 方法 说明 IndexedRecordCciTemplate. createIndexedRecord(String name)Create an indexed Record through the ConnectionFactory's RecordFactory.MappedRecordCciTemplate. createMappedRecord(String name)Create a mapped Record from the ConnectionFactory's RecordFactory.protected RecordCciTemplate. createRecord(RecordCreator recordCreator)Invoke the given RecordCreator, converting JCA ResourceExceptions to Spring's DataAccessException hierarchy.RecordRecordCreator. createRecord(RecordFactory recordFactory)Create a CCI Record instance, usually based on the passed-in CCI RecordFactory.protected <T> TCciTemplate. doExecute(InteractionSpec spec, Record inputRecord, Record outputRecord, RecordExtractor<T> outputExtractor)Execute the specified interaction on an EIS with CCI.TConnectionCallback. doInConnection(Connection connection, ConnectionFactory connectionFactory)Gets called byCciTemplate.executewith an active CCI Connection.TInteractionCallback. doInInteraction(Interaction interaction, ConnectionFactory connectionFactory)Gets called byCciTemplate.executewith an active CCI Interaction.RecordCciOperations. execute(InteractionSpec spec, Record inputRecord)Execute the specified interaction on an EIS with CCI.voidCciOperations. execute(InteractionSpec spec, Record inputRecord, Record outputRecord)Execute the specified interaction on an EIS with CCI.<T> TCciOperations. execute(InteractionSpec spec, Record inputRecord, RecordExtractor<T> outputExtractor)Execute the specified interaction on an EIS with CCI.RecordCciOperations. execute(InteractionSpec spec, RecordCreator inputCreator)Execute the specified interaction on an EIS with CCI.<T> TCciOperations. execute(InteractionSpec spec, RecordCreator inputCreator, RecordExtractor<T> outputExtractor)Execute the specified interaction on an EIS with CCI.<T> TCciOperations. execute(ConnectionCallback<T> action)Execute a request on an EIS with CCI, implemented as callback action working on a CCI Connection.<T> TCciOperations. execute(InteractionCallback<T> action)Execute a request on an EIS with CCI, implemented as callback action working on a CCI Interaction.RecordCciTemplate. execute(InteractionSpec spec, Record inputRecord)voidCciTemplate. execute(InteractionSpec spec, Record inputRecord, Record outputRecord)<T> TCciTemplate. execute(InteractionSpec spec, Record inputRecord, RecordExtractor<T> outputExtractor)RecordCciTemplate. execute(InteractionSpec spec, RecordCreator inputCreator)<T> TCciTemplate. execute(InteractionSpec spec, RecordCreator inputCreator, RecordExtractor<T> outputExtractor)<T> TCciTemplate. execute(ConnectionCallback<T> action)<T> TCciTemplate. execute(InteractionCallback<T> action)TRecordExtractor. extractData(Record record)Process the data in the given Record, creating a corresponding result object.org.springframework.jca.cci.object中DataAccessException的使用
抛出DataAccessException的org.springframework.jca.cci.object中的方法 修饰符和类型 方法 说明 protected abstract ObjectMappingCommAreaOperation. bytesToObject(byte[] bytes)Method used to convert the COMMAREA's bytes to an object.protected abstract RecordMappingRecordOperation. createInputRecord(RecordFactory recordFactory, Object inputObject)Subclasses must implement this method to generate an input Record from an input object passed into theexecutemethod.RecordMappingRecordOperation.RecordCreatorImpl. createRecord(RecordFactory recordFactory)ObjectMappingRecordOperation. execute(Object inputObject)Execute the interaction encapsulated by this operation object.RecordSimpleRecordOperation. execute(Record inputRecord)Execute the CCI interaction encapsulated by this operation object.voidSimpleRecordOperation. execute(Record inputRecord, Record outputRecord)Execute the CCI interaction encapsulated by this operation object.ObjectMappingRecordOperation.RecordExtractorImpl. extractData(Record record)protected ObjectMappingCommAreaOperation. extractOutputData(Record record)protected abstract ObjectMappingRecordOperation. extractOutputData(Record outputRecord)Subclasses must implement this method to convert the Record returned by CCI execution into a result object for theexecutemethod.protected abstract byte[]MappingCommAreaOperation. objectToBytes(Object inObject)Method used to convert an object into COMMAREA bytes.org.springframework.jdbc中DataAccessException的使用
org.springframework.jdbc中DataAccessException的子类 修饰符和类型 类 说明 classBadSqlGrammarExceptionException thrown when SQL specified is invalid.classCannotGetJdbcConnectionExceptionFatal exception thrown when we can't connect to an RDBMS using JDBC.classIncorrectResultSetColumnCountExceptionData access exception thrown when a result set did not have the correct column count, for example when expecting a single column but getting 0 or more than 1 columns.classInvalidResultSetAccessExceptionException thrown when a ResultSet has been accessed in an invalid fashion.classJdbcUpdateAffectedIncorrectNumberOfRowsExceptionException thrown when a JDBC update affects an unexpected number of rows.classLobRetrievalFailureExceptionException to be thrown when a LOB could not be retrieved.classSQLWarningExceptionException thrown when we're not ignoringSQLWarnings.classUncategorizedSQLExceptionException thrown when we can't classify an SQLException into one of our generic data access exceptions.org.springframework.jdbc.core中DataAccessException的使用
返回DataAccessException的org.springframework.jdbc.core中的方法 修饰符和类型 方法 说明 protected DataAccessExceptionJdbcTemplate. translateException(String task, String sql, SQLException ex)Translate the givenSQLExceptioninto a genericDataAccessException.抛出DataAccessException的org.springframework.jdbc.core中的方法 修饰符和类型 方法 说明 int[]JdbcOperations. batchUpdate(String... sql)Issue multiple SQL updates on a single JDBC Statement using batching.<T> int[][]JdbcOperations. batchUpdate(String sql, Collection<T> batchArgs, int batchSize, ParameterizedPreparedStatementSetter<T> pss)Execute multiple batches using the supplied SQL statement with the collect of supplied arguments.int[]JdbcOperations. batchUpdate(String sql, List<Object[]> batchArgs)Execute a batch using the supplied SQL statement with the batch of supplied arguments.int[]JdbcOperations. batchUpdate(String sql, List<Object[]> batchArgs, int[] argTypes)Execute a batch using the supplied SQL statement with the batch of supplied arguments.int[]JdbcOperations. batchUpdate(String sql, BatchPreparedStatementSetter pss)Issue multiple update statements on a single PreparedStatement, using batch updates and a BatchPreparedStatementSetter to set values.int[]JdbcTemplate. batchUpdate(String... sql)<T> int[][]JdbcTemplate. batchUpdate(String sql, Collection<T> batchArgs, int batchSize, ParameterizedPreparedStatementSetter<T> pss)int[]JdbcTemplate. batchUpdate(String sql, List<Object[]> batchArgs)int[]JdbcTemplate. batchUpdate(String sql, List<Object[]> batchArgs, int[] argTypes)int[]JdbcTemplate. batchUpdate(String sql, BatchPreparedStatementSetter pss)Map<String,Object>JdbcOperations. call(CallableStatementCreator csc, List<SqlParameter> declaredParameters)Execute an SQL call using a CallableStatementCreator to provide SQL and any required parameters.Map<String,Object>JdbcTemplate. call(CallableStatementCreator csc, List<SqlParameter> declaredParameters)TCallableStatementCallback. doInCallableStatement(CallableStatement cs)Gets called byJdbcTemplate.executewith an active JDBC CallableStatement.TConnectionCallback. doInConnection(Connection con)Gets called byJdbcTemplate.executewith an active JDBC Connection.TPreparedStatementCallback. doInPreparedStatement(PreparedStatement ps)Gets called byJdbcTemplate.executewith an active JDBC PreparedStatement.TStatementCallback. doInStatement(Statement stmt)Gets called byJdbcTemplate.executewith an active JDBC Statement.voidJdbcOperations. execute(String sql)Issue a single SQL execute, typically a DDL statement.<T> TJdbcOperations. execute(String callString, CallableStatementCallback<T> action)Execute a JDBC data access operation, implemented as callback action working on a JDBC CallableStatement.<T> TJdbcOperations. execute(String sql, PreparedStatementCallback<T> action)Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement.<T> TJdbcOperations. execute(CallableStatementCreator csc, CallableStatementCallback<T> action)Execute a JDBC data access operation, implemented as callback action working on a JDBC CallableStatement.<T> TJdbcOperations. execute(ConnectionCallback<T> action)Execute a JDBC data access operation, implemented as callback action working on a JDBC Connection.<T> TJdbcOperations. execute(PreparedStatementCreator psc, PreparedStatementCallback<T> action)Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement.<T> TJdbcOperations. execute(StatementCallback<T> action)Execute a JDBC data access operation, implemented as callback action working on a JDBC Statement.voidJdbcTemplate. execute(String sql)<T> TJdbcTemplate. execute(String callString, CallableStatementCallback<T> action)<T> TJdbcTemplate. execute(String sql, PreparedStatementCallback<T> action)<T> TJdbcTemplate. execute(CallableStatementCreator csc, CallableStatementCallback<T> action)<T> TJdbcTemplate. execute(ConnectionCallback<T> action)<T> TJdbcTemplate. execute(PreparedStatementCreator psc, PreparedStatementCallback<T> action)<T> TJdbcTemplate. execute(StatementCallback<T> action)TResultSetExtractor. extractData(ResultSet rs)Implementations must implement this method to process the entire ResultSet.<T> TJdbcOperations. query(String sql, Object[] args, int[] argTypes, ResultSetExtractor<T> rse)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.voidJdbcOperations. query(String sql, Object[] args, int[] argTypes, RowCallbackHandler rch)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.<T> List<T>JdbcOperations. query(String sql, Object[] args, int[] argTypes, RowMapper<T> rowMapper)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a result object via a RowMapper.<T> TJdbcOperations. query(String sql, Object[] args, ResultSetExtractor<T> rse)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.voidJdbcOperations. query(String sql, Object[] args, RowCallbackHandler rch)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.<T> List<T>JdbcOperations. query(String sql, Object[] args, RowMapper<T> rowMapper)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a result object via a RowMapper.<T> TJdbcOperations. query(String sql, PreparedStatementSetter pss, ResultSetExtractor<T> rse)Query using a prepared statement, reading the ResultSet with a ResultSetExtractor.voidJdbcOperations. query(String sql, PreparedStatementSetter pss, RowCallbackHandler rch)Query given SQL to create a prepared statement from SQL and a PreparedStatementSetter implementation that knows how to bind values to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.<T> List<T>JdbcOperations. query(String sql, PreparedStatementSetter pss, RowMapper<T> rowMapper)Query given SQL to create a prepared statement from SQL and a PreparedStatementSetter implementation that knows how to bind values to the query, mapping each row to a result object via a RowMapper.<T> TJdbcOperations. query(String sql, ResultSetExtractor<T> rse)Execute a query given static SQL, reading the ResultSet with a ResultSetExtractor.<T> TJdbcOperations. query(String sql, ResultSetExtractor<T> rse, Object... args)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.voidJdbcOperations. query(String sql, RowCallbackHandler rch)Execute a query given static SQL, reading the ResultSet on a per-row basis with a RowCallbackHandler.voidJdbcOperations. query(String sql, RowCallbackHandler rch, Object... args)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.<T> List<T>JdbcOperations. query(String sql, RowMapper<T> rowMapper)Execute a query given static SQL, mapping each row to a result object via a RowMapper.<T> List<T>JdbcOperations. query(String sql, RowMapper<T> rowMapper, Object... args)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a result object via a RowMapper.<T> TJdbcOperations. query(PreparedStatementCreator psc, ResultSetExtractor<T> rse)Query using a prepared statement, reading the ResultSet with a ResultSetExtractor.voidJdbcOperations. query(PreparedStatementCreator psc, RowCallbackHandler rch)Query using a prepared statement, reading the ResultSet on a per-row basis with a RowCallbackHandler.<T> List<T>JdbcOperations. query(PreparedStatementCreator psc, RowMapper<T> rowMapper)Query using a prepared statement, mapping each row to a result object via a RowMapper.<T> TJdbcTemplate. query(String sql, Object[] args, int[] argTypes, ResultSetExtractor<T> rse)voidJdbcTemplate. query(String sql, Object[] args, int[] argTypes, RowCallbackHandler rch)<T> List<T>JdbcTemplate. query(String sql, Object[] args, int[] argTypes, RowMapper<T> rowMapper)<T> TJdbcTemplate. query(String sql, Object[] args, ResultSetExtractor<T> rse)voidJdbcTemplate. query(String sql, Object[] args, RowCallbackHandler rch)<T> List<T>JdbcTemplate. query(String sql, Object[] args, RowMapper<T> rowMapper)<T> TJdbcTemplate. query(String sql, PreparedStatementSetter pss, ResultSetExtractor<T> rse)voidJdbcTemplate. query(String sql, PreparedStatementSetter pss, RowCallbackHandler rch)<T> List<T>JdbcTemplate. query(String sql, PreparedStatementSetter pss, RowMapper<T> rowMapper)<T> TJdbcTemplate. query(String sql, ResultSetExtractor<T> rse)<T> TJdbcTemplate. query(String sql, ResultSetExtractor<T> rse, Object... args)voidJdbcTemplate. query(String sql, RowCallbackHandler rch)voidJdbcTemplate. query(String sql, RowCallbackHandler rch, Object... args)<T> List<T>JdbcTemplate. query(String sql, RowMapper<T> rowMapper)<T> List<T>JdbcTemplate. query(String sql, RowMapper<T> rowMapper, Object... args)<T> TJdbcTemplate. query(PreparedStatementCreator psc, PreparedStatementSetter pss, ResultSetExtractor<T> rse)Query using a prepared statement, allowing for a PreparedStatementCreator and a PreparedStatementSetter.<T> TJdbcTemplate. query(PreparedStatementCreator psc, ResultSetExtractor<T> rse)voidJdbcTemplate. query(PreparedStatementCreator psc, RowCallbackHandler rch)<T> List<T>JdbcTemplate. query(PreparedStatementCreator psc, RowMapper<T> rowMapper)List<Map<String,Object>>JdbcOperations. queryForList(String sql)Execute a query for a result list, given static SQL.<T> List<T>JdbcOperations. queryForList(String sql, Class<T> elementType)Execute a query for a result list, given static SQL.<T> List<T>JdbcOperations. queryForList(String sql, Class<T> elementType, Object... args)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.List<Map<String,Object>>JdbcOperations. queryForList(String sql, Object... args)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.List<Map<String,Object>>JdbcOperations. queryForList(String sql, Object[] args, int[] argTypes)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.<T> List<T>JdbcOperations. queryForList(String sql, Object[] args, int[] argTypes, Class<T> elementType)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.<T> List<T>JdbcOperations. queryForList(String sql, Object[] args, Class<T> elementType)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.List<Map<String,Object>>JdbcTemplate. queryForList(String sql)<T> List<T>JdbcTemplate. queryForList(String sql, Class<T> elementType)<T> List<T>JdbcTemplate. queryForList(String sql, Class<T> elementType, Object... args)List<Map<String,Object>>JdbcTemplate. queryForList(String sql, Object... args)List<Map<String,Object>>JdbcTemplate. queryForList(String sql, Object[] args, int[] argTypes)<T> List<T>JdbcTemplate. queryForList(String sql, Object[] args, int[] argTypes, Class<T> elementType)<T> List<T>JdbcTemplate. queryForList(String sql, Object[] args, Class<T> elementType)Map<String,Object>JdbcOperations. queryForMap(String sql)Execute a query for a result map, given static SQL.Map<String,Object>JdbcOperations. queryForMap(String sql, Object... args)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result map.Map<String,Object>JdbcOperations. queryForMap(String sql, Object[] args, int[] argTypes)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result map.Map<String,Object>JdbcTemplate. queryForMap(String sql)Map<String,Object>JdbcTemplate. queryForMap(String sql, Object... args)Map<String,Object>JdbcTemplate. queryForMap(String sql, Object[] args, int[] argTypes)<T> TJdbcOperations. queryForObject(String sql, Class<T> requiredType)Execute a query for a result object, given static SQL.<T> TJdbcOperations. queryForObject(String sql, Class<T> requiredType, Object... args)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.<T> TJdbcOperations. queryForObject(String sql, Object[] args, int[] argTypes, Class<T> requiredType)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.<T> TJdbcOperations. queryForObject(String sql, Object[] args, int[] argTypes, RowMapper<T> rowMapper)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a result object via a RowMapper.<T> TJdbcOperations. queryForObject(String sql, Object[] args, Class<T> requiredType)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.<T> TJdbcOperations. queryForObject(String sql, Object[] args, RowMapper<T> rowMapper)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a result object via a RowMapper.<T> TJdbcOperations. queryForObject(String sql, RowMapper<T> rowMapper)Execute a query given static SQL, mapping a single result row to a result object via a RowMapper.<T> TJdbcOperations. queryForObject(String sql, RowMapper<T> rowMapper, Object... args)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a result object via a RowMapper.<T> TJdbcTemplate. queryForObject(String sql, Class<T> requiredType)<T> TJdbcTemplate. queryForObject(String sql, Class<T> requiredType, Object... args)<T> TJdbcTemplate. queryForObject(String sql, Object[] args, int[] argTypes, Class<T> requiredType)<T> TJdbcTemplate. queryForObject(String sql, Object[] args, int[] argTypes, RowMapper<T> rowMapper)<T> TJdbcTemplate. queryForObject(String sql, Object[] args, Class<T> requiredType)<T> TJdbcTemplate. queryForObject(String sql, Object[] args, RowMapper<T> rowMapper)<T> TJdbcTemplate. queryForObject(String sql, RowMapper<T> rowMapper)<T> TJdbcTemplate. queryForObject(String sql, RowMapper<T> rowMapper, Object... args)SqlRowSetJdbcOperations. queryForRowSet(String sql)Execute a query for an SqlRowSet, given static SQL.SqlRowSetJdbcOperations. queryForRowSet(String sql, Object... args)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting an SqlRowSet.SqlRowSetJdbcOperations. queryForRowSet(String sql, Object[] args, int[] argTypes)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting an SqlRowSet.SqlRowSetJdbcTemplate. queryForRowSet(String sql)SqlRowSetJdbcTemplate. queryForRowSet(String sql, Object... args)SqlRowSetJdbcTemplate. queryForRowSet(String sql, Object[] args, int[] argTypes)intJdbcOperations. update(String sql)Issue a single SQL update operation (such as an insert, update or delete statement).intJdbcOperations. update(String sql, Object... args)Issue a single SQL update operation (such as an insert, update or delete statement) via a prepared statement, binding the given arguments.intJdbcOperations. update(String sql, Object[] args, int[] argTypes)Issue a single SQL update operation (such as an insert, update or delete statement) via a prepared statement, binding the given arguments.intJdbcOperations. update(String sql, PreparedStatementSetter pss)Issue an update statement using a PreparedStatementSetter to set bind parameters, with given SQL.intJdbcOperations. update(PreparedStatementCreator psc)Issue a single SQL update operation (such as an insert, update or delete statement) using a PreparedStatementCreator to provide SQL and any required parameters.intJdbcOperations. update(PreparedStatementCreator psc, KeyHolder generatedKeyHolder)Issue an update statement using a PreparedStatementCreator to provide SQL and any required parameters.intJdbcTemplate. update(String sql)intJdbcTemplate. update(String sql, Object... args)intJdbcTemplate. update(String sql, Object[] args, int[] argTypes)intJdbcTemplate. update(String sql, PreparedStatementSetter pss)intJdbcTemplate. update(PreparedStatementCreator psc)protected intJdbcTemplate. update(PreparedStatementCreator psc, PreparedStatementSetter pss)intJdbcTemplate. update(PreparedStatementCreator psc, KeyHolder generatedKeyHolder)org.springframework.jdbc.core.namedparam中DataAccessException的使用
抛出DataAccessException的org.springframework.jdbc.core.namedparam中的方法 修饰符和类型 方法 说明 <T> TNamedParameterJdbcOperations. execute(String sql, Map<String,?> paramMap, PreparedStatementCallback<T> action)Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement.<T> TNamedParameterJdbcOperations. execute(String sql, SqlParameterSource paramSource, PreparedStatementCallback<T> action)Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement.<T> TNamedParameterJdbcOperations. execute(String sql, PreparedStatementCallback<T> action)Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement.<T> TNamedParameterJdbcTemplate. execute(String sql, Map<String,?> paramMap, PreparedStatementCallback<T> action)<T> TNamedParameterJdbcTemplate. execute(String sql, SqlParameterSource paramSource, PreparedStatementCallback<T> action)<T> TNamedParameterJdbcTemplate. execute(String sql, PreparedStatementCallback<T> action)<T> TNamedParameterJdbcOperations. query(String sql, Map<String,?> paramMap, ResultSetExtractor<T> rse)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.voidNamedParameterJdbcOperations. query(String sql, Map<String,?> paramMap, RowCallbackHandler rch)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.<T> List<T>NamedParameterJdbcOperations. query(String sql, Map<String,?> paramMap, RowMapper<T> rowMapper)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.<T> TNamedParameterJdbcOperations. query(String sql, SqlParameterSource paramSource, ResultSetExtractor<T> rse)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.voidNamedParameterJdbcOperations. query(String sql, SqlParameterSource paramSource, RowCallbackHandler rch)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.<T> List<T>NamedParameterJdbcOperations. query(String sql, SqlParameterSource paramSource, RowMapper<T> rowMapper)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.<T> TNamedParameterJdbcOperations. query(String sql, ResultSetExtractor<T> rse)Query given SQL to create a prepared statement from SQL, reading the ResultSet with a ResultSetExtractor.voidNamedParameterJdbcOperations. query(String sql, RowCallbackHandler rch)Query given SQL to create a prepared statement from SQL, reading the ResultSet on a per-row basis with a RowCallbackHandler.<T> List<T>NamedParameterJdbcOperations. query(String sql, RowMapper<T> rowMapper)Query given SQL to create a prepared statement from SQL, mapping each row to a Java object via a RowMapper.<T> TNamedParameterJdbcTemplate. query(String sql, Map<String,?> paramMap, ResultSetExtractor<T> rse)voidNamedParameterJdbcTemplate. query(String sql, Map<String,?> paramMap, RowCallbackHandler rch)<T> List<T>NamedParameterJdbcTemplate. query(String sql, Map<String,?> paramMap, RowMapper<T> rowMapper)<T> TNamedParameterJdbcTemplate. query(String sql, SqlParameterSource paramSource, ResultSetExtractor<T> rse)voidNamedParameterJdbcTemplate. query(String sql, SqlParameterSource paramSource, RowCallbackHandler rch)<T> List<T>NamedParameterJdbcTemplate. query(String sql, SqlParameterSource paramSource, RowMapper<T> rowMapper)<T> TNamedParameterJdbcTemplate. query(String sql, ResultSetExtractor<T> rse)voidNamedParameterJdbcTemplate. query(String sql, RowCallbackHandler rch)<T> List<T>NamedParameterJdbcTemplate. query(String sql, RowMapper<T> rowMapper)List<Map<String,Object>>NamedParameterJdbcOperations. queryForList(String sql, Map<String,?> paramMap)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.<T> List<T>NamedParameterJdbcOperations. queryForList(String sql, Map<String,?> paramMap, Class<T> elementType)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.List<Map<String,Object>>NamedParameterJdbcOperations. queryForList(String sql, SqlParameterSource paramSource)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.<T> List<T>NamedParameterJdbcOperations. queryForList(String sql, SqlParameterSource paramSource, Class<T> elementType)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.List<Map<String,Object>>NamedParameterJdbcTemplate. queryForList(String sql, Map<String,?> paramMap)<T> List<T>NamedParameterJdbcTemplate. queryForList(String sql, Map<String,?> paramMap, Class<T> elementType)List<Map<String,Object>>NamedParameterJdbcTemplate. queryForList(String sql, SqlParameterSource paramSource)<T> List<T>NamedParameterJdbcTemplate. queryForList(String sql, SqlParameterSource paramSource, Class<T> elementType)Map<String,Object>NamedParameterJdbcOperations. queryForMap(String sql, Map<String,?> paramMap)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map.Map<String,Object>NamedParameterJdbcOperations. queryForMap(String sql, SqlParameterSource paramSource)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map.Map<String,Object>NamedParameterJdbcTemplate. queryForMap(String sql, Map<String,?> paramMap)Map<String,Object>NamedParameterJdbcTemplate. queryForMap(String sql, SqlParameterSource paramSource)<T> TNamedParameterJdbcOperations. queryForObject(String sql, Map<String,?> paramMap, Class<T> requiredType)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.<T> TNamedParameterJdbcOperations. queryForObject(String sql, Map<String,?> paramMap, RowMapper<T> rowMapper)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.<T> TNamedParameterJdbcOperations. queryForObject(String sql, SqlParameterSource paramSource, Class<T> requiredType)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.<T> TNamedParameterJdbcOperations. queryForObject(String sql, SqlParameterSource paramSource, RowMapper<T> rowMapper)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.<T> TNamedParameterJdbcTemplate. queryForObject(String sql, Map<String,?> paramMap, Class<T> requiredType)<T> TNamedParameterJdbcTemplate. queryForObject(String sql, Map<String,?> paramMap, RowMapper<T> rowMapper)<T> TNamedParameterJdbcTemplate. queryForObject(String sql, SqlParameterSource paramSource, Class<T> requiredType)<T> TNamedParameterJdbcTemplate. queryForObject(String sql, SqlParameterSource paramSource, RowMapper<T> rowMapper)SqlRowSetNamedParameterJdbcOperations. queryForRowSet(String sql, Map<String,?> paramMap)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting an SqlRowSet.SqlRowSetNamedParameterJdbcOperations. queryForRowSet(String sql, SqlParameterSource paramSource)Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting an SqlRowSet.SqlRowSetNamedParameterJdbcTemplate. queryForRowSet(String sql, Map<String,?> paramMap)SqlRowSetNamedParameterJdbcTemplate. queryForRowSet(String sql, SqlParameterSource paramSource)intNamedParameterJdbcOperations. update(String sql, Map<String,?> paramMap)Issue an update via a prepared statement, binding the given arguments.intNamedParameterJdbcOperations. update(String sql, SqlParameterSource paramSource)Issue an update via a prepared statement, binding the given arguments.intNamedParameterJdbcOperations. update(String sql, SqlParameterSource paramSource, KeyHolder generatedKeyHolder)Issue an update via a prepared statement, binding the given arguments, returning generated keys.intNamedParameterJdbcOperations. update(String sql, SqlParameterSource paramSource, KeyHolder generatedKeyHolder, String[] keyColumnNames)Issue an update via a prepared statement, binding the given arguments, returning generated keys.intNamedParameterJdbcTemplate. update(String sql, Map<String,?> paramMap)intNamedParameterJdbcTemplate. update(String sql, SqlParameterSource paramSource)intNamedParameterJdbcTemplate. update(String sql, SqlParameterSource paramSource, KeyHolder generatedKeyHolder)intNamedParameterJdbcTemplate. update(String sql, SqlParameterSource paramSource, KeyHolder generatedKeyHolder, String[] keyColumnNames)org.springframework.jdbc.core.support中DataAccessException的使用
抛出DataAccessException的org.springframework.jdbc.core.support中的方法 修饰符和类型 方法 说明 IntegerAbstractLobCreatingPreparedStatementCallback. doInPreparedStatement(PreparedStatement ps)TAbstractLobStreamingResultSetExtractor. extractData(ResultSet rs)Delegates to handleNoRowFound, handleMultipleRowsFound and streamData, according to the ResultSet state.protected voidAbstractLobStreamingResultSetExtractor. handleMultipleRowsFound()Handle the case where the ResultSet contains multiple rows.protected voidAbstractLobStreamingResultSetExtractor. handleNoRowFound()Handle the case where the ResultSet does not contain a row.protected abstract voidAbstractLobCreatingPreparedStatementCallback. setValues(PreparedStatement ps, LobCreator lobCreator)Set values on the given PreparedStatement, using the given LobCreator for BLOB/CLOB arguments.protected abstract voidAbstractLobStreamingResultSetExtractor. streamData(ResultSet rs)Stream LOB content from the given ResultSet to some OutputStream.org.springframework.jdbc.datasource.init中DataAccessException的使用
org.springframework.jdbc.datasource.init中DataAccessException的子类 修饰符和类型 类 说明 classCannotReadScriptExceptionThrown byScriptUtilsif an SQL script cannot be read.classScriptExceptionRoot of the hierarchy of data access exceptions that are related to processing of SQL scripts.classScriptParseExceptionThrown byScriptUtilsif an SQL script cannot be properly parsed.classScriptStatementFailedExceptionThrown byScriptUtilsif a statement in an SQL script failed when executing it against the target database.classUncategorizedScriptExceptionThrown when we cannot determine anything more specific than "something went wrong while processing an SQL script": for example, aSQLExceptionfrom JDBC that we cannot pinpoint more precisely.抛出DataAccessException的org.springframework.jdbc.datasource.init中的方法 修饰符和类型 方法 说明 static voidDatabasePopulatorUtils. execute(DatabasePopulator populator, DataSource dataSource)Execute the givenDatabasePopulatoragainst the givenDataSource.org.springframework.jdbc.datasource.lookup中DataAccessException的使用
org.springframework.jdbc.datasource.lookup中DataAccessException的子类 修饰符和类型 类 说明 classDataSourceLookupFailureExceptionException to be thrown by a DataSourceLookup implementation, indicating that the specified DataSource could not be obtained.org.springframework.jdbc.object中DataAccessException的使用
抛出DataAccessException的org.springframework.jdbc.object中的方法 修饰符和类型 方法 说明 List<T>SqlQuery. execute()Convenient method to execute without parameters nor context.List<T>SqlQuery. execute(int p1)Convenient method to execute with a single int parameter.List<T>SqlQuery. execute(int p1, int p2)Convenient method to execute with two int parameters.List<T>SqlQuery. execute(int p1, int p2, Map<?,?> context)Convenient method to execute with two int parameters and context.List<T>SqlQuery. execute(int p1, Map<?,?> context)Convenient method to execute with a single int parameter and context.List<T>SqlQuery. execute(long p1)Convenient method to execute with a single long parameter.List<T>SqlQuery. execute(long p1, Map<?,?> context)Convenient method to execute with a single long parameter and context.List<T>SqlQuery. execute(Object... params)Convenient method to execute without context.List<T>SqlQuery. execute(Object[] params, Map<?,?> context)Central execution method.List<T>SqlQuery. execute(String p1)Convenient method to execute with a single String parameter.List<T>SqlQuery. execute(String p1, Map<?,?> context)Convenient method to execute with a single String parameter and context.List<T>SqlQuery. execute(Map<?,?> context)Convenient method to execute without parameters.Map<String,Object>StoredProcedure. execute(Map<String,?> inParams)Execute the stored procedure.Map<String,Object>StoredProcedure. execute(ParameterMapper inParamMapper)Execute the stored procedure.List<T>SqlQuery. executeByNamedParam(Map<String,?> paramMap)Convenient method to execute without context.List<T>SqlQuery. executeByNamedParam(Map<String,?> paramMap, Map<?,?> context)Central execution method.TSqlQuery. findObject(int p1)Convenient method to find a single object given a single int parameter.TSqlQuery. findObject(int p1, int p2)Convenient method to find a single object given two int parameters.TSqlQuery. findObject(int p1, int p2, Map<?,?> context)Convenient method to find a single object given two int parameters and a context.TSqlQuery. findObject(int p1, Map<?,?> context)Convenient method to find a single object given a single int parameter and a context.TSqlQuery. findObject(long p1)Convenient method to find a single object given a single long parameter.TSqlQuery. findObject(long p1, Map<?,?> context)Convenient method to find a single object given a single long parameter and a context.TSqlQuery. findObject(Object... params)Convenient method to find a single object without context.TSqlQuery. findObject(Object[] params, Map<?,?> context)Generic object finder method, used by all otherfindObjectmethods.TSqlQuery. findObject(String p1)Convenient method to find a single object given a single String parameter.TSqlQuery. findObject(String p1, Map<?,?> context)Convenient method to find a single object given a single String parameter and a context.TSqlQuery. findObjectByNamedParam(Map<String,?> paramMap)Convenient method to execute without context.TSqlQuery. findObjectByNamedParam(Map<String,?> paramMap, Map<?,?> context)Generic object finder method for named parameters.intBatchSqlUpdate. update(Object... params)Overridden version ofupdatethat adds the given statement parameters to the queue rather than executing them immediately.intSqlUpdate. update()Convenience method to execute an update with no parameters.intSqlUpdate. update(int p1)Convenient method to execute an update given one int arg.intSqlUpdate. update(int p1, int p2)Convenient method to execute an update given two int args.intSqlUpdate. update(long p1)Convenient method to execute an update given one long arg.intSqlUpdate. update(long p1, long p2)Convenient method to execute an update given two long args.intSqlUpdate. update(Object... params)Generic method to execute the update given parameters.intSqlUpdate. update(Object[] params, KeyHolder generatedKeyHolder)Method to execute the update given arguments and retrieve the generated keys using a KeyHolder.intSqlUpdate. update(String p)Convenient method to execute an update given one String arg.intSqlUpdate. update(String p1, String p2)Convenient method to execute an update given two String args.intSqlUpdate. updateByNamedParam(Map<String,?> paramMap)Generic method to execute the update given named parameters.intSqlUpdate. updateByNamedParam(Map<String,?> paramMap, KeyHolder generatedKeyHolder)Method to execute the update given arguments and retrieve the generated keys using a KeyHolder.org.springframework.jdbc.support中DataAccessException的使用
返回DataAccessException的org.springframework.jdbc.support中的方法 修饰符和类型 方法 说明 protected DataAccessExceptionSQLErrorCodeSQLExceptionTranslator. createCustomException(String task, String sql, SQLException sqlEx, Class<?> exceptionClass)Create a customDataAccessException, based on a given exception class from aCustomSQLErrorCodesTranslationdefinition.protected DataAccessExceptionSQLErrorCodeSQLExceptionTranslator. customTranslate(String task, String sql, SQLException sqlEx)Subclasses can override this method to attempt a custom mapping fromSQLExceptiontoDataAccessException.protected abstract DataAccessExceptionAbstractFallbackSQLExceptionTranslator. doTranslate(String task, String sql, SQLException ex)Template method for actually translating the given exception.protected DataAccessExceptionSQLErrorCodeSQLExceptionTranslator. doTranslate(String task, String sql, SQLException ex)protected DataAccessExceptionSQLExceptionSubclassTranslator. doTranslate(String task, String sql, SQLException ex)protected DataAccessExceptionSQLStateSQLExceptionTranslator. doTranslate(String task, String sql, SQLException ex)DataAccessExceptionAbstractFallbackSQLExceptionTranslator. translate(String task, String sql, SQLException ex)Pre-checks the arguments, callsAbstractFallbackSQLExceptionTranslator.doTranslate(java.lang.String, java.lang.String, java.sql.SQLException), and invokes thefallback translatorif necessary.DataAccessExceptionSQLExceptionTranslator. translate(String task, String sql, SQLException ex)Translate the givenSQLExceptioninto a genericDataAccessException.org.springframework.jdbc.support.incrementer中DataAccessException的使用
抛出DataAccessException的org.springframework.jdbc.support.incrementer中的方法 修饰符和类型 方法 说明 protected longAbstractIdentityColumnMaxValueIncrementer. getNextKey()protected longAbstractSequenceMaxValueIncrementer. getNextKey()Executes the SQL as specified byAbstractSequenceMaxValueIncrementer.getSequenceQuery().protected longMySQLMaxValueIncrementer. getNextKey()intAbstractDataFieldMaxValueIncrementer. nextIntValue()intDataFieldMaxValueIncrementer. nextIntValue()Increment the data store field's max value as int.longAbstractDataFieldMaxValueIncrementer. nextLongValue()longDataFieldMaxValueIncrementer. nextLongValue()Increment the data store field's max value as long.StringAbstractDataFieldMaxValueIncrementer. nextStringValue()StringDataFieldMaxValueIncrementer. nextStringValue()Increment the data store field's max value as String.org.springframework.jdbc.support.xml中DataAccessException的使用
org.springframework.jdbc.support.xml中DataAccessException的子类 修饰符和类型 类 说明 classSqlXmlFeatureNotImplementedExceptionException thrown when the underlying implementation does not support the requested feature of the API.org.springframework.orm中DataAccessException的使用
org.springframework.orm中DataAccessException的子类 修饰符和类型 类 说明 classObjectOptimisticLockingFailureExceptionException thrown on an optimistic locking violation for a mapped object.classObjectRetrievalFailureExceptionException thrown if a mapped object could not be retrieved via its identifier.org.springframework.orm.hibernate5中DataAccessException的使用
org.springframework.orm.hibernate5中DataAccessException的子类 修饰符和类型 类 说明 classHibernateJdbcExceptionHibernate-specific subclass of UncategorizedDataAccessException, for JDBC exceptions that Hibernate wrapped.classHibernateObjectRetrievalFailureExceptionHibernate-specific subclass of ObjectRetrievalFailureException.classHibernateOptimisticLockingFailureExceptionHibernate-specific subclass of ObjectOptimisticLockingFailureException.classHibernateQueryExceptionHibernate-specific subclass of InvalidDataAccessResourceUsageException, thrown on invalid HQL query syntax.classHibernateSystemExceptionHibernate-specific subclass of UncategorizedDataAccessException, for Hibernate system errors that do not match any concreteorg.springframework.daoexceptions.返回DataAccessException的org.springframework.orm.hibernate5中的方法 修饰符和类型 方法 说明 protected DataAccessExceptionHibernateExceptionTranslator. convertHibernateAccessException(HibernateException ex)Convert the given HibernateException to an appropriate exception from theorg.springframework.daohierarchy.protected DataAccessExceptionHibernateTransactionManager. convertHibernateAccessException(HibernateException ex)Convert the given HibernateException to an appropriate exception from theorg.springframework.daohierarchy.static DataAccessExceptionSessionFactoryUtils. convertHibernateAccessException(HibernateException ex)Convert the given HibernateException to an appropriate exception from theorg.springframework.daohierarchy.DataAccessExceptionHibernateExceptionTranslator. translateExceptionIfPossible(RuntimeException ex)抛出DataAccessException的org.springframework.orm.hibernate5中的方法 修饰符和类型 方法 说明 voidSpringSessionSynchronization. beforeCommit(boolean readOnly)intHibernateOperations. bulkUpdate(String queryString, Object... values)已过时。as of 5.0.4, in favor of a customHibernateCallbacklambda code block passed to the generalHibernateOperations.execute(org.springframework.orm.hibernate5.HibernateCallback<T>)methodintHibernateTemplate. bulkUpdate(String queryString, Object... values)已过时。voidHibernateOperations. clear()Remove all objects from theSessioncache, and cancel all pending saves, updates and deletes.voidHibernateTemplate. clear()voidHibernateOperations. closeIterator(Iterator<?> it)已过时。as of 5.0.4, in favor of a customHibernateCallbacklambda code block passed to the generalHibernateOperations.execute(org.springframework.orm.hibernate5.HibernateCallback<T>)methodvoidHibernateTemplate. closeIterator(Iterator<?> it)已过时。booleanHibernateOperations. contains(Object entity)Check whether the given object is in the Session cache.booleanHibernateTemplate. contains(Object entity)voidHibernateOperations. delete(Object entity)Delete the given persistent instance.voidHibernateOperations. delete(Object entity, LockMode lockMode)Delete the given persistent instance.voidHibernateOperations. delete(String entityName, Object entity)Delete the given persistent instance.voidHibernateOperations. delete(String entityName, Object entity, LockMode lockMode)Delete the given persistent instance.voidHibernateTemplate. delete(Object entity)voidHibernateTemplate. delete(Object entity, LockMode lockMode)voidHibernateTemplate. delete(String entityName, Object entity)voidHibernateTemplate. delete(String entityName, Object entity, LockMode lockMode)voidHibernateOperations. deleteAll(Collection<?> entities)Delete all given persistent instances.voidHibernateTemplate. deleteAll(Collection<?> entities)protected <T> THibernateTemplate. doExecute(HibernateCallback<T> action, boolean enforceNativeSession)Execute the action specified by the given action object within a Session.voidHibernateOperations. evict(Object entity)Remove the given object from theSessioncache.voidHibernateTemplate. evict(Object entity)<T> THibernateOperations. execute(HibernateCallback<T> action)Execute the action specified by the given action object within aSession.<T> THibernateTemplate. execute(HibernateCallback<T> action)List<?>HibernateOperations. find(String queryString, Object... values)已过时。as of 5.0.4, in favor of a customHibernateCallbacklambda code block passed to the generalHibernateOperations.execute(org.springframework.orm.hibernate5.HibernateCallback<T>)methodList<?>HibernateTemplate. find(String queryString, Object... values)已过时。List<?>HibernateOperations. findByCriteria(DetachedCriteria criteria)Execute a query based on a given Hibernate criteria object.List<?>HibernateOperations. findByCriteria(DetachedCriteria criteria, int firstResult, int maxResults)Execute a query based on the given Hibernate criteria object.List<?>HibernateTemplate. findByCriteria(DetachedCriteria criteria)List<?>HibernateTemplate. findByCriteria(DetachedCriteria criteria, int firstResult, int maxResults)<T> List<T>HibernateOperations. findByExample(String entityName, T exampleEntity)Execute a query based on the given example entity object.<T> List<T>HibernateOperations. findByExample(String entityName, T exampleEntity, int firstResult, int maxResults)Execute a query based on a given example entity object.<T> List<T>HibernateOperations. findByExample(T exampleEntity)Execute a query based on the given example entity object.<T> List<T>HibernateOperations. findByExample(T exampleEntity, int firstResult, int maxResults)Execute a query based on a given example entity object.<T> List<T>HibernateTemplate. findByExample(String entityName, T exampleEntity)<T> List<T>HibernateTemplate. findByExample(String entityName, T exampleEntity, int firstResult, int maxResults)<T> List<T>HibernateTemplate. findByExample(T exampleEntity)<T> List<T>HibernateTemplate. findByExample(T exampleEntity, int firstResult, int maxResults)List<?>HibernateOperations. findByNamedParam(String queryString, String[] paramNames, Object[] values)已过时。as of 5.0.4, in favor of a customHibernateCallbacklambda code block passed to the generalHibernateOperations.execute(org.springframework.orm.hibernate5.HibernateCallback<T>)methodList<?>HibernateOperations. findByNamedParam(String queryString, String paramName, Object value)已过时。as of 5.0.4, in favor of a customHibernateCallbacklambda code block passed to the generalHibernateOperations.execute(org.springframework.orm.hibernate5.HibernateCallback<T>)methodList<?>HibernateTemplate. findByNamedParam(String queryString, String[] paramNames, Object[] values)已过时。List<?>HibernateTemplate. findByNamedParam(String queryString, String paramName, Object value)已过时。List<?>HibernateOperations. findByNamedQuery(String queryName, Object... values)已过时。as of 5.0.4, in favor of a customHibernateCallbacklambda code block passed to the generalHibernateOperations.execute(org.springframework.orm.hibernate5.HibernateCallback<T>)methodList<?>HibernateTemplate. findByNamedQuery(String queryName, Object... values)已过时。List<?>HibernateOperations. findByNamedQueryAndNamedParam(String queryName, String[] paramNames, Object[] values)已过时。as of 5.0.4, in favor of a customHibernateCallbacklambda code block passed to the generalHibernateOperations.execute(org.springframework.orm.hibernate5.HibernateCallback<T>)methodList<?>HibernateOperations. findByNamedQueryAndNamedParam(String queryName, String paramName, Object value)已过时。as of 5.0.4, in favor of a customHibernateCallbacklambda code block passed to the generalHibernateOperations.execute(org.springframework.orm.hibernate5.HibernateCallback<T>)methodList<?>HibernateTemplate. findByNamedQueryAndNamedParam(String queryName, String[] paramNames, Object[] values)已过时。List<?>HibernateTemplate. findByNamedQueryAndNamedParam(String queryName, String paramName, Object value)已过时。List<?>HibernateOperations. findByNamedQueryAndValueBean(String queryName, Object valueBean)已过时。as of 5.0.4, in favor of a customHibernateCallbacklambda code block passed to the generalHibernateOperations.execute(org.springframework.orm.hibernate5.HibernateCallback<T>)methodList<?>HibernateTemplate. findByNamedQueryAndValueBean(String queryName, Object valueBean)已过时。List<?>HibernateOperations. findByValueBean(String queryString, Object valueBean)已过时。as of 5.0.4, in favor of a customHibernateCallbacklambda code block passed to the generalHibernateOperations.execute(org.springframework.orm.hibernate5.HibernateCallback<T>)methodList<?>HibernateTemplate. findByValueBean(String queryString, Object valueBean)已过时。voidHibernateOperations. flush()Flush all pending saves, updates and deletes to the database.voidHibernateTemplate. flush()<T> THibernateOperations. get(Class<T> entityClass, Serializable id)Return the persistent instance of the given entity class with the given identifier, ornullif not found.<T> THibernateOperations. get(Class<T> entityClass, Serializable id, LockMode lockMode)Return the persistent instance of the given entity class with the given identifier, ornullif not found.ObjectHibernateOperations. get(String entityName, Serializable id)Return the persistent instance of the given entity class with the given identifier, ornullif not found.ObjectHibernateOperations. get(String entityName, Serializable id, LockMode lockMode)Return the persistent instance of the given entity class with the given identifier, ornullif not found.<T> THibernateTemplate. get(Class<T> entityClass, Serializable id)<T> THibernateTemplate. get(Class<T> entityClass, Serializable id, LockMode lockMode)ObjectHibernateTemplate. get(String entityName, Serializable id)ObjectHibernateTemplate. get(String entityName, Serializable id, LockMode lockMode)voidHibernateOperations. initialize(Object proxy)Force initialization of a Hibernate proxy or persistent collection.voidHibernateTemplate. initialize(Object proxy)Iterator<?>HibernateOperations. iterate(String queryString, Object... values)已过时。as of 5.0.4, in favor of a customHibernateCallbacklambda code block passed to the generalHibernateOperations.execute(org.springframework.orm.hibernate5.HibernateCallback<T>)methodIterator<?>HibernateTemplate. iterate(String queryString, Object... values)已过时。<T> THibernateOperations. load(Class<T> entityClass, Serializable id)Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.<T> THibernateOperations. load(Class<T> entityClass, Serializable id, LockMode lockMode)Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.voidHibernateOperations. load(Object entity, Serializable id)Load the persistent instance with the given identifier into the given object, throwing an exception if not found.ObjectHibernateOperations. load(String entityName, Serializable id)Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.ObjectHibernateOperations. load(String entityName, Serializable id, LockMode lockMode)Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.<T> THibernateTemplate. load(Class<T> entityClass, Serializable id)<T> THibernateTemplate. load(Class<T> entityClass, Serializable id, LockMode lockMode)voidHibernateTemplate. load(Object entity, Serializable id)ObjectHibernateTemplate. load(String entityName, Serializable id)ObjectHibernateTemplate. load(String entityName, Serializable id, LockMode lockMode)<T> List<T>HibernateOperations. loadAll(Class<T> entityClass)Return all persistent instances of the given entity class.<T> List<T>HibernateTemplate. loadAll(Class<T> entityClass)voidHibernateOperations. lock(Object entity, LockMode lockMode)Obtain the specified lock level upon the given object, implicitly checking whether the corresponding database entry still exists.voidHibernateOperations. lock(String entityName, Object entity, LockMode lockMode)Obtain the specified lock level upon the given object, implicitly checking whether the corresponding database entry still exists.voidHibernateTemplate. lock(Object entity, LockMode lockMode)voidHibernateTemplate. lock(String entityName, Object entity, LockMode lockMode)<T> THibernateOperations. merge(String entityName, T entity)Copy the state of the given object onto the persistent object with the same identifier.<T> THibernateOperations. merge(T entity)Copy the state of the given object onto the persistent object with the same identifier.<T> THibernateTemplate. merge(String entityName, T entity)<T> THibernateTemplate. merge(T entity)voidHibernateOperations. persist(Object entity)Persist the given transient instance.voidHibernateOperations. persist(String entityName, Object entity)Persist the given transient instance.voidHibernateTemplate. persist(Object entity)voidHibernateTemplate. persist(String entityName, Object entity)voidHibernateOperations. refresh(Object entity)Re-read the state of the given persistent instance.voidHibernateOperations. refresh(Object entity, LockMode lockMode)Re-read the state of the given persistent instance.voidHibernateTemplate. refresh(Object entity)voidHibernateTemplate. refresh(Object entity, LockMode lockMode)voidHibernateOperations. replicate(Object entity, ReplicationMode replicationMode)Persist the state of the given detached instance according to the given replication mode, reusing the current identifier value.voidHibernateOperations. replicate(String entityName, Object entity, ReplicationMode replicationMode)Persist the state of the given detached instance according to the given replication mode, reusing the current identifier value.voidHibernateTemplate. replicate(Object entity, ReplicationMode replicationMode)voidHibernateTemplate. replicate(String entityName, Object entity, ReplicationMode replicationMode)SerializableHibernateOperations. save(Object entity)Persist the given transient instance.SerializableHibernateOperations. save(String entityName, Object entity)Persist the given transient instance.SerializableHibernateTemplate. save(Object entity)SerializableHibernateTemplate. save(String entityName, Object entity)voidHibernateOperations. saveOrUpdate(Object entity)Save or update the given persistent instance, according to its id (matching the configured "unsaved-value"?).voidHibernateOperations. saveOrUpdate(String entityName, Object entity)Save or update the given persistent instance, according to its id (matching the configured "unsaved-value"?).voidHibernateTemplate. saveOrUpdate(Object entity)voidHibernateTemplate. saveOrUpdate(String entityName, Object entity)voidHibernateOperations. update(Object entity)Update the given persistent instance, associating it with the current HibernateSession.voidHibernateOperations. update(Object entity, LockMode lockMode)Update the given persistent instance, associating it with the current HibernateSession.voidHibernateOperations. update(String entityName, Object entity)Update the given persistent instance, associating it with the current HibernateSession.voidHibernateOperations. update(String entityName, Object entity, LockMode lockMode)Update the given persistent instance, associating it with the current HibernateSession.voidHibernateTemplate. update(Object entity)voidHibernateTemplate. update(Object entity, LockMode lockMode)voidHibernateTemplate. update(String entityName, Object entity)voidHibernateTemplate. update(String entityName, Object entity, LockMode lockMode)org.springframework.orm.hibernate5.support中DataAccessException的使用
抛出DataAccessException的org.springframework.orm.hibernate5.support中的方法 修饰符和类型 方法 说明 voidOpenSessionInViewInterceptor. afterCompletion(WebRequest request, Exception ex)Unbind the HibernateSessionfrom the thread and close it).voidOpenSessionInViewInterceptor. preHandle(WebRequest request)Open a new HibernateSessionaccording and bind it to the thread via theTransactionSynchronizationManager.org.springframework.orm.jpa中DataAccessException的使用
org.springframework.orm.jpa中DataAccessException的子类 修饰符和类型 类 说明 classJpaObjectRetrievalFailureExceptionJPA-specific subclass of ObjectRetrievalFailureException.classJpaOptimisticLockingFailureExceptionJPA-specific subclass of ObjectOptimisticLockingFailureException.classJpaSystemExceptionJPA-specific subclass of UncategorizedDataAccessException, for JPA system errors that do not match any concreteorg.springframework.daoexceptions.返回DataAccessException的org.springframework.orm.jpa中的方法 修饰符和类型 方法 说明 static DataAccessExceptionEntityManagerFactoryUtils. convertJpaAccessExceptionIfPossible(RuntimeException ex)Convert the given runtime exception to an appropriate exception from theorg.springframework.daohierarchy.DataAccessExceptionAbstractEntityManagerFactoryBean. translateExceptionIfPossible(RuntimeException ex)Implementation of the PersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor.DataAccessExceptionDefaultJpaDialect. translateExceptionIfPossible(RuntimeException ex)This implementation delegates to EntityManagerFactoryUtils.org.springframework.orm.jpa.support中DataAccessException的使用
抛出DataAccessException的org.springframework.orm.jpa.support中的方法 修饰符和类型 方法 说明 voidOpenEntityManagerInViewInterceptor. afterCompletion(WebRequest request, Exception ex)voidOpenEntityManagerInViewInterceptor. preHandle(WebRequest request)org.springframework.orm.jpa.vendor中DataAccessException的使用
返回DataAccessException的org.springframework.orm.jpa.vendor中的方法 修饰符和类型 方法 说明 protected DataAccessExceptionHibernateJpaDialect. convertHibernateAccessException(HibernateException ex)Convert the given HibernateException to an appropriate exception from theorg.springframework.daohierarchy.DataAccessExceptionHibernateJpaDialect. translateExceptionIfPossible(RuntimeException ex)org.springframework.test.context.junit4中DataAccessException的使用
抛出DataAccessException的org.springframework.test.context.junit4中的方法 修饰符和类型 方法 说明 protected voidAbstractTransactionalJUnit4SpringContextTests. executeSqlScript(String sqlResourcePath, boolean continueOnError)Execute the given SQL script.org.springframework.test.context.testng中DataAccessException的使用
抛出DataAccessException的org.springframework.test.context.testng中的方法 修饰符和类型 方法 说明 protected voidAbstractTransactionalTestNGSpringContextTests. executeSqlScript(String sqlResourcePath, boolean continueOnError)Execute the given SQL script.