Package javax.persistence

Examples of javax.persistence.Converts


        infoMap.put( info.getAttributeName(), info );
      }
    }
    {
      // @Converts annotation on the Embeddable class level
      final Converts convertsAnnotation = embeddableXClass.getAnnotation( Converts.class );
      if ( convertsAnnotation != null ) {
        for ( Convert convertAnnotation : convertsAnnotation.value() ) {
          final AttributeConversionInfo info = new AttributeConversionInfo( convertAnnotation, embeddableXClass );
          if ( StringHelper.isEmpty( info.getAttributeName() ) ) {
            throw new IllegalStateException( "@Converts placed on @Embeddable must define attributeName" );
          }
          infoMap.put( info.getAttributeName(), info );
        }
      }
    }

    // then we can overlay any conversions from the Embedded attribute
    {
      // @Convert annotation on the Embedded attribute
      final Convert convertAnnotation = embeddedXProperty.getAnnotation( Convert.class );
      if ( convertAnnotation != null ) {
        final AttributeConversionInfo info = new AttributeConversionInfo( convertAnnotation, embeddableXClass );
        if ( StringHelper.isEmpty( info.getAttributeName() ) ) {
          throw new IllegalStateException( "Convert placed on Embedded attribute must define (sub)attributeName" );
        }
        infoMap.put( info.getAttributeName(), info );
      }
    }
    {
      // @Converts annotation on the Embedded attribute
      final Converts convertsAnnotation = embeddedXProperty.getAnnotation( Converts.class );
      if ( convertsAnnotation != null ) {
        for ( Convert convertAnnotation : convertsAnnotation.value() ) {
          final AttributeConversionInfo info = new AttributeConversionInfo( convertAnnotation, embeddableXClass );
          if ( StringHelper.isEmpty( info.getAttributeName() ) ) {
            throw new IllegalStateException( "Convert placed on Embedded attribute must define (sub)attributeName" );
          }
          infoMap.put( info.getAttributeName(), info );
View Full Code Here


        attributeConversionInfoMap.put( property.getName(), info );
      }
    }
    {
      // @Converts annotation on the Embeddable attribute
      final Converts convertsAnnotation = property.getAnnotation( Converts.class );
      if ( convertsAnnotation != null ) {
        for ( Convert convertAnnotation : convertsAnnotation.value() ) {
          final AttributeConversionInfo info = new AttributeConversionInfo( convertAnnotation, property );
          attributeConversionInfoMap.put( property.getName(), info );
        }
      }
    }
View Full Code Here

        return convertAnnotation;
      }
    }

    {
      Converts convertsAnnotation = owner.getAnnotation( Converts.class );
      if ( convertsAnnotation != null ) {
        for ( Convert convertAnnotation : convertsAnnotation.value() ) {
          if ( isMatch( convertAnnotation, property ) ) {
            return convertAnnotation;
          }
        }
      }
View Full Code Here

        }
        infoMap.put( info.getAttributeName(), info );
      }
    }
    {
      final Converts convertsAnnotation = xClass.getAnnotation( Converts.class );
      if ( convertsAnnotation != null ) {
        for ( Convert convertAnnotation : convertsAnnotation.value() ) {
          final AttributeConversionInfo info = new AttributeConversionInfo( convertAnnotation, xClass );
          if ( StringHelper.isEmpty( info.getAttributeName() ) ) {
            throw new IllegalStateException( "@Converts placed on @Entity/@MappedSuperclass must define attributeName" );
          }
          infoMap.put( info.getAttributeName(), info );
View Full Code Here

        }
      }
    }
    {
      // @Converts annotation on the Embeddable attribute
      final Converts convertsAnnotation = property.getAnnotation( Converts.class );
      if ( convertsAnnotation != null ) {
        for ( Convert convertAnnotation : convertsAnnotation.value() ) {
          final AttributeConversionInfo info = new AttributeConversionInfo( convertAnnotation, property );
          if ( StringHelper.isEmpty( info.getAttributeName() ) ) {
            attributeConversionInfoMap.put( propertyName, info );
          }
          else {
View Full Code Here

TOP

Related Classes of javax.persistence.Converts

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.