Package org.hibernate.mapping

Examples of org.hibernate.mapping.MappedSuperclass


        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 = safeMapping.getDeclaredPropertyIterator();
          while ( properties.hasNext() ) {
            final Property property = properties.next();
            if ( safeMapping.isVersioned() && property == safeMapping.getVersion() ) {
              // skip the version property, it was already handled previously.
              continue;
            }
            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

        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 = safeMapping.getDeclaredPropertyIterator();
          while ( properties.hasNext() ) {
            final Property property = properties.next();
            if ( safeMapping.isVersioned() && property == safeMapping.getVersion() ) {
              // skip the version property, it was already handled previously.
              continue;
            }
            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

  }

  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

    }

    classNames.add( persistentClass.getEntityName() );

    if ( ! isBase ) {
      MappedSuperclass msc = persistentClass.getSuperMappedSuperclass();
      while ( msc != null ) {
        classNames.add( msc.getMappedClass().getName() );
        msc = msc.getSuperMappedSuperclass();
      }

      associateSubclassNamesToSubclassTableIndexes( persistentClass, classNames, mapping, factory );
    }
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

        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 = safeMapping.getDeclaredPropertyIterator();
          while ( properties.hasNext() ) {
            final Property property = properties.next();
            if ( safeMapping.isVersioned() && property == safeMapping.getVersion() ) {
              // skip the version property, it was already handled previously.
              continue;
            }
            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

        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 = safeMapping.getDeclaredPropertyIterator();
          while ( properties.hasNext() ) {
            final Property property = properties.next();
            if ( safeMapping.isVersioned() && property == safeMapping.getVersion() ) {
              // skip the version property, it was already handled previously.
              continue;
            }
            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

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.