Code example for TableGenerator

Methods: configure

0
    private SqlAction sql = null;
 
    @Override 
    public void configure(Type type, Properties params, Dialect dialect)
            throws MappingException {
        super.configure(type, params, dialect);
    } 
 
    public void setSqlAction(SqlAction sql) {
        this.sql = sql;
    } 
 
    public synchronized Serializable generate(final SessionImplementor session,
            Object obj) { 
 
        if (hiValue < 0 || value >= hiValue) {
            hiValue = sql.nextValue(getSegmentValue(), getIncrementSize());
            if (log.isDebugEnabled()) { 
                log.debug("Loaded new hiValue " + hiValue + " for "
                        + getSegmentValue());