Example usage for org.hibernate.mapping Subclass getTable

List of usage examples for org.hibernate.mapping Subclass getTable

Introduction

In this page you can find the example usage for org.hibernate.mapping Subclass getTable.

Prototype

public Table getTable() 

Source Link

Usage

From source file:org.codehaus.groovy.grails.orm.hibernate.cfg.AbstractGrailsDomainBinder.java

License:Apache License

/**
 * Binds a sub-class using table-per-hierarchy inheritance mapping
 *
 * @param sub      The Grails domain class instance representing the sub-class
 * @param subClass The Hibernate SubClass instance
 * @param mappings The mappings instance
 *//*from w  w  w .ja v  a 2  s.  c om*/
protected void bindSubClass(GrailsDomainClass sub, Subclass subClass, Mappings mappings,
        String sessionFactoryBeanName) {
    bindClass(sub, subClass, mappings);

    if (subClass.getEntityPersisterClass() == null) {
        subClass.getRootClass().setEntityPersisterClass(getGroovyAwareSingleTableEntityPersisterClass());
    }

    if (LOG.isDebugEnabled())
        LOG.debug("Mapping subclass: " + subClass.getEntityName() + " -> " + subClass.getTable().getName());

    // properties
    createClassProperties(sub, subClass, mappings, sessionFactoryBeanName);
}

From source file:org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.java

License:Apache License

/**
 * Binds a sub-class using table-per-hierarchy inheritance mapping
 *
 * @param sub      The Grails domain class instance representing the sub-class
 * @param subClass The Hibernate SubClass instance
 * @param mappings The mappings instance
 *///from   ww w .j  a v  a2  s .  co m
private static void bindSubClass(GrailsDomainClass sub, Subclass subClass, Mappings mappings,
        String sessionFactoryBeanName) {
    bindClass(sub, subClass, mappings);

    if (subClass.getEntityPersisterClass() == null) {
        subClass.getRootClass().setEntityPersisterClass(GroovyAwareSingleTableEntityPersister.class);
        //                    .setEntityPersisterClass(SingleTableEntityPersister.class);
    }

    if (LOG.isDebugEnabled())
        LOG.debug("Mapping subclass: " + subClass.getEntityName() + " -> " + subClass.getTable().getName());

    // properties
    createClassProperties(sub, subClass, mappings, sessionFactoryBeanName);
}

From source file:org.grails.orm.hibernate.cfg.AbstractGrailsDomainBinder.java

License:Apache License

/**
 * Binds a sub-class using table-per-hierarchy inheritance mapping
 *
 * @param sub      The Grails domain class instance representing the sub-class
 * @param subClass The Hibernate SubClass instance
 * @param mappings The mappings instance
 *///from   w  w w .j  ava  2s.c  om
protected void bindSubClass(HibernatePersistentEntity sub, Subclass subClass, Mappings mappings,
        String sessionFactoryBeanName) {
    bindClass(sub, subClass, mappings);

    if (subClass.getEntityPersisterClass() == null) {
        subClass.getRootClass().setEntityPersisterClass(getGroovyAwareSingleTableEntityPersisterClass());
    }

    if (LOG.isDebugEnabled())
        LOG.debug("Mapping subclass: " + subClass.getEntityName() + " -> " + subClass.getTable().getName());

    // properties
    createClassProperties(sub, subClass, mappings, sessionFactoryBeanName);
}

From source file:org.grails.orm.hibernate.cfg.GrailsDomainBinder.java

License:Apache License

/**
 * Binds a sub-class using table-per-hierarchy inheritance mapping
 *
 * @param sub      The Grails domain class instance representing the sub-class
 * @param subClass The Hibernate SubClass instance
 * @param mappings The mappings instance
 *//*ww  w . ja v a2 s.  c o  m*/
protected void bindSubClass(HibernatePersistentEntity sub, Subclass subClass,
        InFlightMetadataCollector mappings, String sessionFactoryBeanName) {
    bindClass(sub, subClass, mappings);

    if (LOG.isDebugEnabled())
        LOG.debug("Mapping subclass: " + subClass.getEntityName() + " -> " + subClass.getTable().getName());

    // properties
    createClassProperties(sub, subClass, mappings, sessionFactoryBeanName);
}