Package javax.persistence

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


  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

    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

    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

  private final AccessType defaultAccessType;
  private final InheritanceType inheritanceType;
  private final List<T> configuredClasses;

  public static ConfiguredClassHierarchy<EntityClass> createEntityClassHierarchy(List<ClassInfo> classInfoList, AnnotationBindingContext context) {
    AccessType defaultAccessType = determineDefaultAccessType( classInfoList );
    InheritanceType inheritanceType = determineInheritanceType( classInfoList );
    return new ConfiguredClassHierarchy<EntityClass>(
        classInfoList,
        context,
        defaultAccessType,
View Full Code Here

   * @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 ( embeddedIdAnnotations != null && !embeddedIdAnnotations.isEmpty() ) {
View Full Code Here

//
//    return accessType;
  }

  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

    }
  }

  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 ) {
      accessType = JandexHelper.getValueAsEnum( accessAnnotation, "value", AccessType.class );
    }
View Full Code Here

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

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

      // when class access type is field
      // overriding access annotations must be placed on properties and have the access type PROPERTY
      if ( AccessType.FIELD.equals( classAccessType ) ) {
        if ( !( annotationTarget instanceof MethodInfo ) ) {
View Full Code Here

          rootClassWithAllSubclasses,
          processedEntities,
          classToDirectSubClassMap
      );

      AccessType defaultAccessType = determineDefaultAccessType( rootClassWithAllSubclasses );
      InheritanceType hierarchyInheritanceType = determineInheritanceType(
          rootClassInfo,
          rootClassWithAllSubclasses
      );
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.