java.lang.Object
st.orm.template.impl.QueryImpl
st.orm.template.impl.PreparedQueryImpl
- All Implemented Interfaces:
AutoCloseable,PreparedQuery,Query
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class st.orm.template.impl.QueryImpl
executeBatch, executeUpdate, getOptionalResult, getOptionalResult, getRefList, getRefStream, getResultCount, getResultList, getResultList, getResultStream, getResultStream, getSingleResult, getSingleResult, isVersionAware, prepare, unsafeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface st.orm.template.Query
executeBatch, executeUpdate, getOptionalResult, getOptionalResult, getRefList, getRefStream, getResultCount, getResultList, getResultList, getResultStream, getResultStream, getSingleResult, getSingleResult, isVersionAware, prepare, unsafe
-
Constructor Details
-
PreparedQueryImpl
public PreparedQueryImpl(st.orm.core.template.PreparedQuery core)
-
-
Method Details
-
addBatch
Description copied from interface:PreparedQueryAdd a record to the batch.- Specified by:
addBatchin interfacePreparedQuery- Parameters:
record- the record to add to the batch.
-
getGeneratedKeys
Description copied from interface:PreparedQueryReturns a stream of generated keys as the result of an insert statement. Returns an empty stream if the insert statement did not generate any keys.The returned stream allows for lazy processing, meaning elements are generated only as they are consumed, optimizing resource usage. Note, however, that calling this method does trigger the execution of the underlying query, so it should only be invoked when the query is intended to run. Since the stream holds resources open while in use, it must be closed after usage to prevent resource leaks. As the stream is AutoCloseable, it is recommended to use it within a try-with-resources block.
- Specified by:
getGeneratedKeysin interfacePreparedQuery- Type Parameters:
ID- the type of generated keys- Parameters:
type- the class of the keys- Returns:
- a stream of generated keys resulting from an insert statement; returns an empty stream if no keys are generated.
-
close
public void close()Description copied from interface:PreparedQueryClose the resources associated with this query.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfacePreparedQuery
-