Methods Summary |
---|
public AccessCallback | buildCallback(org.hibernate.engine.SessionImplementor session)
return new AccessCallback() {
public long getNextValue() {
accessCounter++;
try {
PreparedStatement st = session.getBatcher().prepareSelectStatement( sql );
try {
ResultSet rs = st.executeQuery();
try {
rs.next();
long result = rs.getLong( 1 );
if ( log.isDebugEnabled() ) {
log.debug("Sequence identifier generated: " + result);
}
return result;
}
finally {
try {
rs.close();
}
catch( Throwable ignore ) {
// intentionally empty
}
}
}
finally {
session.getBatcher().closeStatement( st );
}
}
catch ( SQLException sqle) {
throw JDBCExceptionHelper.convert(
session.getFactory().getSQLExceptionConverter(),
sqle,
"could not get next sequence value",
sql
);
}
}
};
|
public int | getIncrementSize()
return incrementSize;
|
public java.lang.String | getName()
return sequenceName;
|
public int | getTimesAccessed()
return accessCounter;
|
public void | prepare(Optimizer optimizer)
applyIncrementSizeToSourceValues = optimizer.applyIncrementSizeToSourceValues();
|
public java.lang.String[] | sqlCreateStrings(org.hibernate.dialect.Dialect dialect)
int sourceIncrementSize = applyIncrementSizeToSourceValues ? incrementSize : 1;
return dialect.getCreateSequenceStrings( sequenceName, initialValue, sourceIncrementSize );
|
public java.lang.String[] | sqlDropStrings(org.hibernate.dialect.Dialect dialect)
return dialect.getDropSequenceStrings( sequenceName );
|