Code example for TableHiLoGenerator

0
 * TableHiLoGenerator which uses control shard to store table with hi values. 
 * 
 * @author Tomislav Nad 
 * @see org.hibernate.id.TableHiLoGenerator 
 */ 
public class ShardedTableHiLoGenerator extends TableHiLoGenerator implements GeneratorRequiringControlSessionProvider {
 
    private ControlSessionProvider controlSessionProvider;
 
    @Override 
    public Serializable generate(final SessionImplementor session, final Object obj) throws HibernateException {
        Serializable id;
        SessionImplementor controlSession = null;
        try { 
            controlSession = controlSessionProvider.openControlSession();
            id = superGenerate(controlSession, obj);
        } finally { 
            if (controlSession != null) {
                ((Session) controlSession).close();
            } 
Connect your IDE to all the code out there  Get Codota for Java