Hibernate ORM IdentifierGenerator - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM IdentifierGenerator class.

This code example shows how to use the following methods: generate
    public NativeHiLoGenerator() { 
        super(); 
    } 
 
    public Serializable generate(SessionImplementor session, Object object) throws HibernateException {
        return _proxy.generate(session, object);
    } 
 
    public Object generatorKey() { 
        if (_proxy instanceof PersistentIdentifierGenerator)
            return ((PersistentIdentifierGenerator) _proxy).generatorKey();
        else 
            return this;
    } 
 
    public String[] sqlCreateStrings(Dialect dialect) throws HibernateException {
        if (_proxy instanceof PersistentIdentifierGenerator)
            return ((PersistentIdentifierGenerator) _proxy).sqlCreateStrings(dialect);
        else 
            return new String[] {};
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: generate
                                                      ((SessionFactoryImpl) sessionFactory).getDialect());
    } 
 
    public Serializable getId() {
        StatelessSession session = sessionFactory.openStatelessSession();
        Serializable id = generator.generate((StatelessSessionImpl) session, new ID());
        session.close();
        return id;
    } 
 
    /** 
     * Target object for ID generation 
     */ 
    private static class ID { 
        private Integer id;
         
        @Id 
        public Integer getId() {
            return id;
        } 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
See Code Examples for Hibernate ORM IdentifierGenerator Methods: