Package javax.persistence

Examples of javax.persistence.AccessType


      }
    }
  }

  private static AccessType getDefaultAccessForHierarchy(TypeElement element, Context context) {
    AccessType defaultAccessType = null;
    TypeElement superClass = element;
    do {
      superClass = TypeUtils.getSuperclassTypeElement( superClass );
      if ( superClass != null ) {
        String fqcn = superClass.getQualifiedName().toString();
View Full Code Here


    while ( superClass != null );
    return defaultAccessType;
  }

  private static AccessType getAccessTypeInCaseElementIsRoot(TypeElement searchedElement, Context context) {
    AccessType defaultAccessType = null;
    List<? extends Element> myMembers = searchedElement.getEnclosedElements();
    for ( Element subElement : myMembers ) {
      List<? extends AnnotationMirror> entityAnnotations =
          context.getElementUtils().getAllAnnotationMirrors( subElement );
      for ( Object entityAnnotation : entityAnnotations ) {
View Full Code Here

    }
    return defaultAccessType;
  }

  private static AccessType getAccessTypeOfIdAnnotation(Element element) {
    AccessType accessType = null;
    final ElementKind kind = element.getKind();
    if ( kind == ElementKind.FIELD || kind == ElementKind.METHOD ) {
      accessType = kind == ElementKind.FIELD ? AccessType.FIELD : AccessType.PROPERTY;
    }
    return accessType;
View Full Code Here

        || TypeUtils.isAnnotationMirrorOfType( annotationMirror, EmbeddedId.class );
  }

  public static 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

    return element;
  }

  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, Transient.class )
View Full Code Here

      );
      final TypeElement collectionElement = (TypeElement) context.getTypeUtils()
          .asElement( collectionElementType );
      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

    this.typeUtility   = processingEnv.getTypeUtils();
    this.logger = logger;
  }

  public int determineTypeAccess(TypeElement type) {
        AccessType access = getExplicitAccessType(type);
        boolean isExplicit = access != null;
        return isExplicit ? access == AccessType.FIELD
                ? AccessCode.EXPLICIT | AccessCode.FIELD
                : AccessCode.EXPLICIT | AccessCode.PROPERTY
                : getImplicitAccessType(type);
View Full Code Here

      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

  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

      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

TOP

Related Classes of javax.persistence.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.