Package org.hibernate.annotations

Examples of org.hibernate.annotations.AccessType


      explicitAccessType = superEntityState != null ?
          superEntityState.accessType :
          null;
    }
    else {
      AccessType access = clazzToProcess.getAnnotation( AccessType.class );
      explicitAccessType = access != null ?
          access.value() :
          null;
      if ( "property".equals( explicitAccessType ) ) {
        isExplicitPropertyAnnotated = Boolean.TRUE;
      }
      else if ( "field".equals( explicitAccessType ) ) {
View Full Code Here


  private static boolean addElementsOfAClass(
      List<PropertyData> elements, PropertyHolder propertyHolder, boolean isPropertyAnnotated,
      String propertyAccessor, final XClass annotatedClass, ExtendedMappings mappings
  ) {
    boolean hasIdentifier = false;
    AccessType access = annotatedClass.getAnnotation( AccessType.class );
    String localPropertyAccessor = access != null ?
        access.value() :
        null;
    String accessType = null;
    if ( "property".equals( localPropertyAccessor ) || "field".equals( localPropertyAccessor ) ) {
      accessType = localPropertyAccessor;
    }
View Full Code Here

      AnnotationDescriptor ad = new AnnotationDescriptor( AccessType.class );
      ad.setValue( "value", access );
      return AnnotationFactory.create( ad );
    }
    else if ( defaults.canUseJavaAnnotations() && isJavaAnnotationPresent( AccessType.class ) ) {
      AccessType annotation = getJavaAnnotation( AccessType.class );
      return annotation;
    }
    else if ( defaults.getAccess() != null ) {
      AnnotationDescriptor ad = new AnnotationDescriptor( AccessType.class );
      ad.setValue( "value", defaults.getAccess() );
View Full Code Here

  }

  public String getDefaultAccess() throws MappingException {
    // if(skip())
    // return defaultAccess;
    AccessType access = property.getAnnotation( AccessType.class );
    return access != null ? access.value() : defaultAccess;
  }
View Full Code Here

  public void setPropertyAccessor(String propertyAccessor) {
    this.propertyAccessor = propertyAccessor;
  }

  public boolean isPropertyAnnotated(XAnnotatedElement element) {
    AccessType access = element.getAnnotation( AccessType.class );
    if ( access == null ) return isPropertyAnnotated;
    String propertyAccessor = access.value();
    if ( "property".equals( propertyAccessor ) ) {
      return Boolean.TRUE;
    }
    else if ( "field".equals( propertyAccessor ) ) {
      return Boolean.FALSE;
View Full Code Here

      return isPropertyAnnotated;
    }
  }

  public String getPropertyAccessor(XAnnotatedElement element) {
    AccessType access = element.getAnnotation( AccessType.class );
    if ( access == null ) return propertyAccessor;
    return access.value();
  }
View Full Code Here

          );
      isExplicitPropertyAnnotated = superEntityState != null ? superEntityState.isPropertyAnnotated : null;
      explicitAccessType = superEntityState != null ? superEntityState.accessType : null;
    }
    else {
      AccessType access = clazzToProcess.getAnnotation( AccessType.class );
      explicitAccessType = access != null ? access.value() : null;
      if ( "property".equals( explicitAccessType ) ) {
        isExplicitPropertyAnnotated = Boolean.TRUE;
      }
      else if ( "field".equals( explicitAccessType ) ) {
        isExplicitPropertyAnnotated = Boolean.FALSE;
View Full Code Here

  private static boolean addElementsOfAClass(
      List<PropertyData> elements, PropertyHolder propertyHolder, boolean isPropertyAnnotated,
      String propertyAccessor, final XClass annotatedClass, ExtendedMappings mappings
  ) {
    boolean hasIdentifier = false;
    AccessType access = annotatedClass.getAnnotation( AccessType.class );
    String localPropertyAccessor = access != null ? access.value() : null;
    String accessType = null;
    if ( "property".equals( localPropertyAccessor ) || "field".equals( localPropertyAccessor ) ) {
      accessType = localPropertyAccessor;
    }
    else {
View Full Code Here

      explicitAccessType = superEntityState != null ?
          superEntityState.accessType :
          null;
    }
    else {
      AccessType access = clazzToProcess.getAnnotation( AccessType.class );
      explicitAccessType = access != null ?
          access.value() :
          null;
      if ( "property".equals( explicitAccessType ) ) {
        isExplicitPropertyAnnotated = Boolean.TRUE;
      }
      else if ( "field".equals( explicitAccessType ) ) {
View Full Code Here

  private static boolean addElementsOfAClass(
      List<PropertyData> elements, PropertyHolder propertyHolder, boolean isPropertyAnnotated,
      String propertyAccessor, final XClass annotatedClass, ExtendedMappings mappings
  ) {
    boolean hasIdentifier = false;
    AccessType access = annotatedClass.getAnnotation( AccessType.class );
    String localPropertyAccessor = access != null ?
        access.value() :
        null;
    String accessType = null;
    if ( "property".equals( localPropertyAccessor ) || "field".equals( localPropertyAccessor ) ) {
      accessType = localPropertyAccessor;
    }
View Full Code Here

TOP

Related Classes of org.hibernate.annotations.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.