Package org.hibernate.mapping

Examples of org.hibernate.mapping.MappedSuperclass


  }

  private void addPropertyToMappedSuperclass(Property prop, XClass declaringClass) {
    final Mappings mappings = getMappings();
    final Class type = mappings.getReflectionManager().toClass( declaringClass );
    MappedSuperclass superclass = mappings.getMappedSuperclass( type );
    superclass.addDeclaredProperty( prop );
  }
View Full Code Here


  //TODO remove / reduce @SW scope
  @SuppressWarnings( "unchecked" )
  private static EntityTypeImpl<?> buildEntityType(PersistentClass persistentClass, MetadataContext context) {
    final Class javaType = persistentClass.getMappedClass();
    context.pushEntityWorkedOn(persistentClass);
    final MappedSuperclass superMappedSuperclass = persistentClass.getSuperMappedSuperclass();
    AbstractIdentifiableType<?> superType = superMappedSuperclass == null
        ? null
        : locateOrBuildMappedsuperclassType( superMappedSuperclass, context );
    //no mappedSuperclass, check for a super entity
    if (superType == null) {
View Full Code Here

  //TODO remove / reduce @SW scope
  @SuppressWarnings( "unchecked" )
  private static MappedSuperclassTypeImpl<?> buildMappedSuperclassType(MappedSuperclass mappedSuperclass,
                                     MetadataContext context) {
    final MappedSuperclass superMappedSuperclass = mappedSuperclass.getSuperMappedSuperclass();
    AbstractIdentifiableType<?> superType = superMappedSuperclass == null
        ? null
        : locateOrBuildMappedsuperclassType( superMappedSuperclass, context );
    //no mappedSuperclass, check for a super entity
    if (superType == null) {
View Full Code Here

  }

  private void addPropertyToMappedSuperclass(Property prop, XClass declaringClass) {
    final ExtendedMappings mappings = getMappings();
    final Class type = mappings.getReflectionManager().toClass( declaringClass );
    MappedSuperclass superclass = mappings.getMappedSuperclass( type );
    superclass.addDeclaredProperty( prop );
  }
View Full Code Here

        finally {
          log.trace( "Completed entity [{}]", safeMapping.getEntityName() );
        }
      }
      else if ( MappedSuperclass.class.isAssignableFrom( mapping.getClass() ) ) {
        @SuppressWarnings( "unchecked" )
        final MappedSuperclass safeMapping = (MappedSuperclass) mapping;
        log.trace( "Starting mapped superclass [{}]", safeMapping.getMappedClass().getName() );
        try {
          final MappedSuperclassTypeImpl<?> jpa2Mapping = mappedSuperclassByMappedSuperclassMapping.get(
              safeMapping
          );
          applyIdMetadata( safeMapping, jpa2Mapping );
          applyVersionAttribute( safeMapping, jpa2Mapping );
          Iterator<Property> properties = ( Iterator<Property> ) safeMapping.getDeclaredPropertyIterator();
          while ( properties.hasNext() ) {
            final Property property = properties.next();
            final Attribute attribute = attributeFactory.buildAttribute( jpa2Mapping, property );
            if ( attribute != null ) {
              jpa2Mapping.getBuilder().addAttribute( attribute );
            }
          }
          jpa2Mapping.lock();
          populateStaticMetamodel( jpa2Mapping );
        }
        finally {
          log.trace( "Completed mapped superclass [{}]", safeMapping.getMappedClass().getName() );
        }
      }
      else {
        throw new AssertionFailure( "Unexpected mapping type: " + mapping.getClass() );
      }
View Full Code Here

  //TODO remove / reduce @SW scope
  @SuppressWarnings( "unchecked" )
  private static EntityTypeImpl<?> buildEntityType(PersistentClass persistentClass, MetadataContext context) {
    final Class javaType = persistentClass.getMappedClass();
    context.pushEntityWorkedOn(persistentClass);
    final MappedSuperclass superMappedSuperclass = persistentClass.getSuperMappedSuperclass();
    AbstractIdentifiableType<?> superType = superMappedSuperclass == null
        ? null
        : locateOrBuildMappedsuperclassType( superMappedSuperclass, context );
    //no mappedSuperclass, check for a super entity
    if (superType == null) {
View Full Code Here

  //TODO remove / reduce @SW scope
  @SuppressWarnings( "unchecked" )
  private static MappedSuperclassTypeImpl<?> buildMappedSuperclassType(MappedSuperclass mappedSuperclass,
                                     MetadataContext context) {
    final MappedSuperclass superMappedSuperclass = mappedSuperclass.getSuperMappedSuperclass();
    AbstractIdentifiableType<?> superType = superMappedSuperclass == null
        ? null
        : locateOrBuildMappedsuperclassType( superMappedSuperclass, context );
    //no mappedSuperclass, check for a super entity
    if (superType == null) {
View Full Code Here

        }
        jpa2Mapping.lock();
        populateStaticMetamodel( jpa2Mapping );
      }
      else if ( MappedSuperclass.class.isAssignableFrom( mapping.getClass() ) ) {
        @SuppressWarnings( "unchecked" )
        final MappedSuperclass safeMapping = (MappedSuperclass) mapping;
        final MappedSuperclassTypeImpl<?> jpa2Mapping = mappedSuperclassByMappedSuperclassMapping.get(
            safeMapping
        );
        applyIdMetadata( safeMapping, jpa2Mapping );
        applyVersionAttribute( safeMapping, jpa2Mapping );
        Iterator<Property> properties = ( Iterator<Property> ) safeMapping.getDeclaredPropertyIterator();
        while ( properties.hasNext() ) {
          final Property property = properties.next();
          final Attribute attribute = attributeFactory.buildAttribute( jpa2Mapping, property, true );
          jpa2Mapping.getBuilder().addAttribute( attribute );
        }
View Full Code Here

        }
        jpa2Mapping.lock();
        populateStaticMetamodel( jpa2Mapping );
      }
      else if ( MappedSuperclass.class.isAssignableFrom( mapping.getClass() ) ) {
        @SuppressWarnings( "unchecked" )
        final MappedSuperclass safeMapping = (MappedSuperclass) mapping;
        final MappedSuperclassTypeImpl<?> jpa2Mapping = mappedSuperclassByMappedSuperclassMapping.get(
            safeMapping
        );
        applyIdMetadata( safeMapping, jpa2Mapping );
        applyVersionAttribute( safeMapping, jpa2Mapping );
        Iterator<Property> properties = ( Iterator<Property> ) safeMapping.getDeclaredPropertyIterator();
        while ( properties.hasNext() ) {
          final Property property = properties.next();
          final Attribute attribute = attributeFactory.buildAttribute( jpa2Mapping, property );
          if ( attribute != null ) {
            jpa2Mapping.getBuilder().addAttribute( attribute );
View Full Code Here

  }

  private void addPropertyToMappedSuperclass(Property prop, XClass declaringClass) {
    final Mappings mappings = getMappings();
    final Class type = mappings.getReflectionManager().toClass( declaringClass );
    MappedSuperclass superclass = mappings.getMappedSuperclass( type );
    superclass.addDeclaredProperty( prop );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.mapping.MappedSuperclass

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.