Methods Summary |
---|
public void | configure(org.hibernate.type.Type type, java.util.Properties params, org.hibernate.dialect.Dialect dialect)
sequenceName = PropertiesHelper.getString(SEQUENCE, params, "hibernate_sequence");
parameters = params.getProperty(PARAMETERS);
String schemaName = params.getProperty(SCHEMA);
String catalogName = params.getProperty(CATALOG);
if (sequenceName.indexOf( '." ) < 0) {
sequenceName = Table.qualify( catalogName, schemaName, sequenceName );
}
this.identifierType = type;
sql = dialect.getSequenceNextValString(sequenceName);
|
public java.io.Serializable | generate(org.hibernate.engine.SessionImplementor session, java.lang.Object obj)
try {
PreparedStatement st = session.getBatcher().prepareSelectStatement(sql);
try {
ResultSet rs = st.executeQuery();
try {
rs.next();
Serializable result = IdentifierGeneratorFactory.get(
rs, identifierType
);
if ( log.isDebugEnabled() ) {
log.debug("Sequence identifier generated: " + result);
}
return result;
}
finally {
rs.close();
}
}
finally {
session.getBatcher().closeStatement(st);
}
}
catch (SQLException sqle) {
throw JDBCExceptionHelper.convert(
session.getFactory().getSQLExceptionConverter(),
sqle,
"could not get next sequence value",
sql
);
}
|
public java.lang.Object | generatorKey()
return sequenceName;
|
public java.lang.String | getSequenceName()
return sequenceName;
|
public java.lang.String[] | sqlCreateStrings(org.hibernate.dialect.Dialect dialect)
String[] ddl = dialect.getCreateSequenceStrings(sequenceName);
if ( parameters != null ) {
ddl[ddl.length - 1] += ' " + parameters;
}
return ddl;
|
public java.lang.String[] | sqlDropStrings(org.hibernate.dialect.Dialect dialect)
return dialect.getDropSequenceStrings(sequenceName);
|