Package javax.persistence

Examples of javax.persistence.Access


        public AccessFilter(AccessType target) {
            this.target = target;
        }

        public boolean includes(AnnotatedElement obj) {
          Access access = obj.getAnnotation(Access.class);
          return access != null && access.value().equals(target);
        }
View Full Code Here


     * Explicit access type specification does not affect the access type of
     * other entity classes or mapped super classes in the entity hierarchy.
     */
    private int getAccessCode(Class<?> cls) {
        int accessCode = AccessCode.UNKNOWN;
        Access access = AccessController.doPrivileged(
            J2DoPrivHelper.getAnnotationAction(cls, Access.class));
        if (access != null) {
            accessCode |=  AccessCode.EXPLICIT |
                (access.value() == AccessType.FIELD ?
                AccessCode.FIELD : AccessCode.PROPERTY);
        }
        return accessCode;
    }
View Full Code Here

     * as a field during some other owning entity.
     *
     * @see ValueMetaData#addEmbeddedMetaData()
     */
    private int determineExplicitAccessType(Class<?> cls) {
        Access access = cls.getAnnotation(Access.class);
        return access == null ? AccessCode.UNKNOWN : ((access.value() ==
            AccessType.FIELD ? AccessCode.FIELD : AccessCode.PROPERTY) |
            AccessCode.EXPLICIT);
    }
View Full Code Here

     *         type matches the expected type
     */
    private boolean isAnnotatedAccess(Member member, AccessType type) {
      if (member == null)
        return false;
        Access anno =
            AccessController.doPrivileged(J2DoPrivHelper
                .getAnnotationAction((AnnotatedElement)member,
                Access.class));
        return anno != null && anno.value() == type;
    }   
View Full Code Here

        public AccessFilter(AccessType target) {
            this.target = target;
        }

        public boolean includes(AnnotatedElement obj) {
          Access access = obj.getAnnotation(Access.class);
          return access != null && access.value().equals(target);
        }
View Full Code Here

     * Explicit access type specification does not affect the access type of
     * other entity classes or mapped super classes in the entity hierarchy.
     */
    private int getAccessCode(Class<?> cls) {
        int accessCode = AccessCode.UNKNOWN;
        Access access = AccessController.doPrivileged(
            J2DoPrivHelper.getAnnotationAction(cls, Access.class));
        if (access != null) {
            accessCode |=  AccessCode.EXPLICIT |
                (access.value() == AccessType.FIELD ?
                AccessCode.FIELD : AccessCode.PROPERTY);
        }
        return accessCode;
    }
View Full Code Here

    }
  }

  private void considerExplicitFieldAndPropertyAccess() {
    for ( XProperty property : fieldAccessMap.values() ) {
      Access access = property.getAnnotation( Access.class );
      if ( access == null ) {
        continue;
      }

      // see "2.3.2 Explicit Access Type" of JPA 2 spec
      // the access type for this property is explicitly set to AccessType.FIELD, hence we have to
      // use field access for this property even if the default access type for the class is AccessType.PROPERTY
      AccessType accessType = AccessType.getAccessStrategy( access.value() );
            if (accessType == AccessType.FIELD) propertyAccessMap.put(property.getName(), property);
            else LOG.annotationHasNoEffect(AccessType.FIELD);
    }

    for ( XProperty property : propertyAccessMap.values() ) {
      Access access = property.getAnnotation( Access.class );
      if ( access == null ) {
        continue;
      }

      AccessType accessType = AccessType.getAccessStrategy( access.value() );

      // see "2.3.2 Explicit Access Type" of JPA 2 spec
      // the access type for this property is explicitly set to AccessType.PROPERTY, hence we have to
      // return use method access even if the default class access type is AccessType.FIELD
            if (accessType == AccessType.PROPERTY) fieldAccessMap.put(property.getName(), property);
View Full Code Here

    org.hibernate.annotations.AccessType accessType = xClass.getAnnotation( org.hibernate.annotations.AccessType.class );
    if ( accessType != null ) {
      hibernateDefinedAccessType = AccessType.getAccessStrategy( accessType.value() );
    }

    Access access = xClass.getAnnotation( Access.class );
    if ( access != null ) {
      jpaDefinedAccessType = AccessType.getAccessStrategy( access.value() );
    }

    if ( hibernateDefinedAccessType != AccessType.DEFAULT
        && jpaDefinedAccessType != AccessType.DEFAULT
        && hibernateDefinedAccessType != jpaDefinedAccessType ) {
View Full Code Here

    org.hibernate.annotations.AccessType accessTypeAnnotation = element.getAnnotation( org.hibernate.annotations.AccessType.class );
    if ( accessTypeAnnotation != null ) {
      hibernateAccessType = AccessType.getAccessStrategy( accessTypeAnnotation.value() );
    }

    Access access = element.getAnnotation( Access.class );
    if ( access != null ) {
      jpaAccessType = AccessType.getAccessStrategy( access.value() );
    }

    if ( hibernateAccessType != null && jpaAccessType != null && hibernateAccessType != jpaAccessType ) {
      throw new MappingException(
          "Found @Access and @AccessType with conflicting values on a property in class " + annotatedClass.toString()
View Full Code Here

     * Explicit access type specification does not affect the access type of
     * other entity classes or mapped super classes in the entity hierarchy.
     */
    private int getAccessCode(Class<?> cls) {
        int accessCode = AccessCode.UNKNOWN;
        Access access = AccessController.doPrivileged(
            J2DoPrivHelper.getAnnotationAction(cls, Access.class));
        if (access != null) {
            accessCode |=  AccessCode.EXPLICIT |
                (access.value() == AccessType.FIELD ?
                AccessCode.FIELD : AccessCode.PROPERTY);
        }
        return accessCode;
    }
View Full Code Here

TOP

Related Classes of javax.persistence.Access

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.