Package org.hibernate.jpamodelgen.util

Examples of org.hibernate.jpamodelgen.util.AccessType


    Elements utils = context.getElementUtils();
    return utils.getTypeElement( fullyQualifiedClassName );
  }

  private AccessType determineEntityAccessType(EntityMappings mappings) {
    AccessType accessType = context.getPersistenceUnitDefaultAccessType();
    if ( mappings.getAccess() != null ) {
      accessType = mapXmlAccessTypeToJpaAccessType( mappings.getAccess() );
    }
    return accessType;
  }
View Full Code Here


  private void determineXmlAccessTypes() {
    for ( EntityMappings mappings : entityMappings ) {
      String fqcn;
      String packageName = mappings.getPackage();
      AccessType defaultAccessType = determineEntityAccessType( mappings );

      for ( Entity entity : mappings.getEntity() ) {
        String name = entity.getClazz();
        fqcn = StringUtil.determineFullyQualifiedClassName( packageName, name );
        AccessType explicitAccessType = null;
        org.hibernate.jpamodelgen.xml.jaxb.AccessType type = entity.getAccess();
        if ( type != null ) {
          explicitAccessType = mapXmlAccessTypeToJpaAccessType( type );
        }
        AccessTypeInformation accessInfo = new AccessTypeInformation(
            fqcn, explicitAccessType, defaultAccessType
        );
        context.addAccessTypeInformation( fqcn, accessInfo );
      }

      for ( org.hibernate.jpamodelgen.xml.jaxb.MappedSuperclass mappedSuperClass : mappings.getMappedSuperclass() ) {
        String name = mappedSuperClass.getClazz();
        fqcn = StringUtil.determineFullyQualifiedClassName( packageName, name );
        AccessType explicitAccessType = null;
        org.hibernate.jpamodelgen.xml.jaxb.AccessType type = mappedSuperClass.getAccess();
        if ( type != null ) {
          explicitAccessType = mapXmlAccessTypeToJpaAccessType( type );
        }
        AccessTypeInformation accessInfo = new AccessTypeInformation(
            fqcn, explicitAccessType, defaultAccessType
        );
        context.addAccessTypeInformation( fqcn, accessInfo );
      }

      for ( org.hibernate.jpamodelgen.xml.jaxb.Embeddable embeddable : mappings.getEmbeddable() ) {
        String name = embeddable.getClazz();
        fqcn = StringUtil.determineFullyQualifiedClassName( packageName, name );
        AccessType explicitAccessType = null;
        org.hibernate.jpamodelgen.xml.jaxb.AccessType type = embeddable.getAccess();
        if ( type != null ) {
          explicitAccessType = mapXmlAccessTypeToJpaAccessType( type );
        }
        AccessTypeInformation accessInfo = new AccessTypeInformation(
View Full Code Here

    addPersistentMembers( methodsOfClass, AccessType.PROPERTY );
  }

  private void addPersistentMembers(List<? extends Element> membersOfClass, AccessType membersKind) {
    for ( Element memberOfClass : membersOfClass ) {
      AccessType forcedAccessType = TypeUtils.determineAnnotationSpecifiedAccessType( memberOfClass );
      if ( entityAccessTypeInfo.getAccessType() != membersKind && forcedAccessType == null ) {
        continue;
      }

      if ( TypeUtils.containsAnnotation( memberOfClass, Constants.TRANSIENT )
View Full Code Here

      AccessTypeInformation accessTypeInfo = context.getAccessTypeInfo(
          collectionElement.getQualifiedName()
              .toString()
      );
      if ( accessTypeInfo == null ) {
        AccessType explicitAccessType = TypeUtils.determineAnnotationSpecifiedAccessType(
            collectionElement
        );
        accessTypeInfo = new AccessTypeInformation(
            collectionElement.getQualifiedName().toString(),
            explicitAccessType,
View Full Code Here

    Elements utils = context.getElementUtils();
    return utils.getTypeElement( fullyQualifiedClassName );
  }

  private AccessType determineEntityAccessType(EntityMappings mappings) {
    AccessType accessType = context.getPersistenceUnitDefaultAccessType();
    if ( mappings.getAccess() != null ) {
      accessType = mapXmlAccessTypeToJpaAccessType( mappings.getAccess() );
    }
    return accessType;
  }
View Full Code Here

  private void determineXmlAccessTypes() {
    for ( EntityMappings mappings : entityMappings ) {
      String fqcn;
      String packageName = mappings.getPackage();
      AccessType defaultAccessType = determineEntityAccessType( mappings );

      for ( Entity entity : mappings.getEntity() ) {
        String name = entity.getClazz();
        fqcn = StringUtil.determineFullyQualifiedClassName( packageName, name );
        AccessType explicitAccessType = null;
        org.hibernate.jpamodelgen.xml.jaxb.AccessType type = entity.getAccess();
        if ( type != null ) {
          explicitAccessType = mapXmlAccessTypeToJpaAccessType( type );
        }
        AccessTypeInformation accessInfo = new AccessTypeInformation(
            fqcn, explicitAccessType, defaultAccessType
        );
        context.addAccessTypeInformation( fqcn, accessInfo );
      }

      for ( org.hibernate.jpamodelgen.xml.jaxb.MappedSuperclass mappedSuperClass : mappings.getMappedSuperclass() ) {
        String name = mappedSuperClass.getClazz();
        fqcn = StringUtil.determineFullyQualifiedClassName( packageName, name );
        AccessType explicitAccessType = null;
        org.hibernate.jpamodelgen.xml.jaxb.AccessType type = mappedSuperClass.getAccess();
        if ( type != null ) {
          explicitAccessType = mapXmlAccessTypeToJpaAccessType( type );
        }
        AccessTypeInformation accessInfo = new AccessTypeInformation(
            fqcn, explicitAccessType, defaultAccessType
        );
        context.addAccessTypeInformation( fqcn, accessInfo );
      }

      for ( org.hibernate.jpamodelgen.xml.jaxb.Embeddable embeddable : mappings.getEmbeddable() ) {
        String name = embeddable.getClazz();
        fqcn = StringUtil.determineFullyQualifiedClassName( packageName, name );
        AccessType explicitAccessType = null;
        org.hibernate.jpamodelgen.xml.jaxb.AccessType type = embeddable.getAccess();
        if ( type != null ) {
          explicitAccessType = mapXmlAccessTypeToJpaAccessType( type );
        }
        AccessTypeInformation accessInfo = new AccessTypeInformation(
View Full Code Here

    initialized = true;
  }

  private void addPersistentMembers(List<? extends Element> membersOfClass, AccessType membersKind) {
    for ( Element memberOfClass : membersOfClass ) {
      AccessType forcedAccessType = TypeUtils.determineAnnotationSpecifiedAccessType( memberOfClass );
      if ( entityAccessTypeInfo.getAccessType() != membersKind && forcedAccessType == null ) {
        continue;
      }

      if ( TypeUtils.containsAnnotation( memberOfClass, Constants.TRANSIENT )
View Full Code Here

      AccessTypeInformation accessTypeInfo = context.getAccessTypeInfo(
          collectionElement.getQualifiedName()
              .toString()
      );
      if ( accessTypeInfo == null ) {
        AccessType explicitAccessType = TypeUtils.determineAnnotationSpecifiedAccessType(
            collectionElement
        );
        accessTypeInfo = new AccessTypeInformation(
            collectionElement.getQualifiedName().toString(),
            explicitAccessType,
View Full Code Here

    Elements utils = context.getElementUtils();
    return utils.getTypeElement( fullyQualifiedClassName );
  }

  private AccessType determineEntityAccessType(EntityMappings mappings) {
    AccessType accessType = context.getPersistenceUnitDefaultAccessType();
    if ( mappings.getAccess() != null ) {
      accessType = mapXmlAccessTypeToJpaAccessType( mappings.getAccess() );
    }
    return accessType;
  }
View Full Code Here

  private void determineXmlAccessTypes() {
    for ( EntityMappings mappings : entityMappings ) {
      String fqcn;
      String packageName = mappings.getPackage();
      AccessType defaultAccessType = determineEntityAccessType( mappings );

      for ( Entity entity : mappings.getEntity() ) {
        String name = entity.getClazz();
        fqcn = StringUtil.determineFullyQualifiedClassName( packageName, name );
        AccessType explicitAccessType = null;
        org.hibernate.jpamodelgen.xml.jaxb.AccessType type = entity.getAccess();
        if ( type != null ) {
          explicitAccessType = mapXmlAccessTypeToJpaAccessType( type );
        }
        AccessTypeInformation accessInfo = new AccessTypeInformation(
            fqcn, explicitAccessType, defaultAccessType
        );
        context.addAccessTypeInformation( fqcn, accessInfo );
      }

      for ( org.hibernate.jpamodelgen.xml.jaxb.MappedSuperclass mappedSuperClass : mappings.getMappedSuperclass() ) {
        String name = mappedSuperClass.getClazz();
        fqcn = StringUtil.determineFullyQualifiedClassName( packageName, name );
        AccessType explicitAccessType = null;
        org.hibernate.jpamodelgen.xml.jaxb.AccessType type = mappedSuperClass.getAccess();
        if ( type != null ) {
          explicitAccessType = mapXmlAccessTypeToJpaAccessType( type );
        }
        AccessTypeInformation accessInfo = new AccessTypeInformation(
            fqcn, explicitAccessType, defaultAccessType
        );
        context.addAccessTypeInformation( fqcn, accessInfo );
      }

      for ( org.hibernate.jpamodelgen.xml.jaxb.Embeddable embeddable : mappings.getEmbeddable() ) {
        String name = embeddable.getClazz();
        fqcn = StringUtil.determineFullyQualifiedClassName( packageName, name );
        AccessType explicitAccessType = null;
        org.hibernate.jpamodelgen.xml.jaxb.AccessType type = embeddable.getAccess();
        if ( type != null ) {
          explicitAccessType = mapXmlAccessTypeToJpaAccessType( type );
        }
        AccessTypeInformation accessInfo = new AccessTypeInformation(
View Full Code Here

TOP

Related Classes of org.hibernate.jpamodelgen.util.AccessType

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.