Examples of AccessType


Examples of javax.persistence.AccessType

    return forcedAccessType;
  }

  private AccessType determineAnnotationSpecifiedAccessType(Element element) {
    final AnnotationMirror accessAnnotationMirror = TypeUtils.getAnnotationMirror( element, Access.class );
    AccessType forcedAccessType = null;
    if ( accessAnnotationMirror != null ) {
      Element accessElement = ( Element ) TypeUtils.getAnnotationValue(
          accessAnnotationMirror,
          DEFAULT_ANNOTATION_PARAMETER_NAME
      );
View Full Code Here

Examples of javax.persistence.AccessType

      boolean correctAccessType = false;
      if ( this.explicitAccessType == null ) {
        correctAccessType = true;
      }
      else {
        AccessType annotationAccessType = determineAnnotationSpecifiedAccessType( element );
        if ( explicitAccessType.equals( annotationAccessType ) ) {
          correctAccessType = true;
        }
      }
      return correctAccessType
View Full Code Here

Examples of javax.persistence.AccessType

          rootClassWithAllSubclasses,
          processedEntities,
          classToDirectSubClassMap
      );

      AccessType defaultAccessType = determineDefaultAccessType( rootClassWithAllSubclasses );
      InheritanceType hierarchyInheritanceType = determineInheritanceType(
          rootClassInfo,
          rootClassWithAllSubclasses
      );
View Full Code Here

Examples of javax.persistence.AccessType

   * @return Returns the default access type for the configured class hierarchy independent of explicit
   *         {@code AccessType} annotations. The default access type is determined by the placement of the
   *         annotations.
   */
  private static AccessType determineDefaultAccessType(List<ClassInfo> classes) {
    AccessType accessTypeByEmbeddedIdPlacement = null;
    AccessType accessTypeByIdPlacement = null;
    for ( ClassInfo info : classes ) {
      List<AnnotationInstance> idAnnotations = info.annotations().get( JPADotNames.ID );
      List<AnnotationInstance> embeddedIdAnnotations = info.annotations().get( JPADotNames.EMBEDDED_ID );

      if ( CollectionHelper.isNotEmpty( embeddedIdAnnotations ) ) {
View Full Code Here

Examples of javax.persistence.AccessType

      return throwIdNotFoundAnnotationException( classes );
    }
  }

  private static AccessType determineAccessTypeByIdPlacement(List<AnnotationInstance> idAnnotations) {
    AccessType accessType = null;
    for ( AnnotationInstance annotation : idAnnotations ) {
      AccessType tmpAccessType;
      if ( annotation.target() instanceof FieldInfo ) {
        tmpAccessType = AccessType.FIELD;
      }
      else if ( annotation.target() instanceof MethodInfo ) {
        tmpAccessType = AccessType.PROPERTY;
View Full Code Here

Examples of javax.persistence.AccessType

    }
  }

  private AccessType determineClassAccessType(AccessType defaultAccessType) {
    // default to the hierarchy access type to start with
    AccessType accessType = defaultAccessType;

    AnnotationInstance accessAnnotation = JandexHelper.getSingleAnnotation( classInfo, JPADotNames.ACCESS );
    if ( accessAnnotation != null && accessAnnotation.target().getClass().equals( ClassInfo.class ) ) {
      accessType = JandexHelper.getEnumValue( accessAnnotation, "value", AccessType.class );
    }
View Full Code Here

Examples of javax.persistence.AccessType

      if ( !( annotationTarget.getClass().equals( MethodInfo.class ) || annotationTarget.getClass()
          .equals( FieldInfo.class ) ) ) {
        continue;
      }

      AccessType accessType = JandexHelper.getEnumValue( accessAnnotation, "value", AccessType.class );

      if ( !isExplicitAttributeAccessAnnotationPlacedCorrectly( annotationTarget, accessType ) ) {
        continue;
      }
View Full Code Here

Examples of javax.persistence.AccessType

      setAccess( access, defaultType );
    }
  }

  private void setAccess( String access, Default defaultType) {
    AccessType type;
    if ( access != null ) {
      try {
        type = AccessType.valueOf( access );
      }
      catch ( IllegalArgumentException e ) {
View Full Code Here

Examples of javax.persistence.AccessType

      return;
    }
    String access = element.attributeValue( "access" );
    if ( access != null ) {
      AnnotationDescriptor ad = new AnnotationDescriptor( Access.class );
      AccessType type;
      try {
        type = AccessType.valueOf( access );
      }
      catch ( IllegalArgumentException e ) {
        throw new AnnotationException( access + " is not a valid access type. Check you xml confguration." );
View Full Code Here

Examples of javax.persistence.AccessType

  private Access getAccessType(Element tree, XMLContext.Default defaults) {
    String access = tree == null ? null : tree.attributeValue( "access" );
    if ( access != null ) {
      AnnotationDescriptor ad = new AnnotationDescriptor( Access.class );
      AccessType type;
      try {
        type = AccessType.valueOf( access );
      }
      catch ( IllegalArgumentException e ) {
        throw new AnnotationException( access + " is not a valid access type. Check you xml confguration." );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.