Examples of Convert


Examples of javax.persistence.Convert

    // from the Embedded

    // first apply conversions from the Embeddable...
    {
      // @Convert annotation on the Embeddable class level
      final Convert convertAnnotation = embeddableXClass.getAnnotation( Convert.class );
      if ( convertAnnotation != null ) {
        final AttributeConversionInfo info = new AttributeConversionInfo( convertAnnotation, embeddableXClass );
        if ( StringHelper.isEmpty( info.getAttributeName() ) ) {
          throw new IllegalStateException( "@Convert placed on @Embeddable must define attributeName" );
        }
        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" );
        }
View Full Code Here

Examples of javax.persistence.Convert

      return;
    }

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

Examples of javax.persistence.Convert

    if ( ! canContainConvert ) {
      return;
    }

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

Examples of javax.persistence.Convert

      return;
    }

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

Examples of javax.persistence.Convert

      // not sure this is valid condition
      return;
    }

    {
      final Convert convertAnnotation = collectionProperty.getAnnotation( Convert.class );
      if ( convertAnnotation != null ) {
        applyLocalConvert( convertAnnotation, collectionProperty, elementAttributeConversionInfoMap, keyAttributeConversionInfoMap );
      }
    }
View Full Code Here

Examples of javax.persistence.Convert

    // from the Embedded

    // first apply conversions from the Embeddable...
    {
      // @Convert annotation on the Embeddable class level
      final Convert convertAnnotation = embeddableXClass.getAnnotation( Convert.class );
      if ( convertAnnotation != null ) {
        final AttributeConversionInfo info = new AttributeConversionInfo( convertAnnotation, embeddableXClass );
        if ( StringHelper.isEmpty( info.getAttributeName() ) ) {
          throw new IllegalStateException( "@Convert placed on @Embeddable must define attributeName" );
        }
        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" );
        }
View Full Code Here

Examples of javax.persistence.Convert

      return;
    }

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

Examples of ma.glasnost.orika.impl.generator.specification.Convert

   
    DefaultCodeGenerationStrategy() {
       
        this.specifications = new ArrayList<Specification>();
       
        specifications.add(new Convert());
        specifications.add(new CopyByReference());
        specifications.add(new ApplyRegisteredMapper());
        specifications.add(new EnumToEnum());
        specifications.add(new StringToEnum());
        specifications.add(new UnmappableEnum());
View Full Code Here

Examples of org.allspice.bytecode.instructions.Convert

      Var x = new Var(0,TypeName.OBJECT) ;
      MethodDef md = new MethodDef(new TypeName(type),"getFoo",x) ;
      md = md.setStatic(true) ;
      md = md.addInstructions(
          new Load(x),
          new Convert(TypeCode.getType(x.getType()),new TypeName(type)),
          new Return(TypeCode.getType(type))
          ) ;
      cd = cd.addMethod(md) ;
    }
    return cd ;
View Full Code Here

Examples of org.allspice.bytecode.instructions.Convert

      md = md.setStatic(true) ;
      md = md.addInstructions(
          new Load(x),
          new Load(y),
          new Dup(TypeCode.LONG,TypeCode.INT),
          new Convert(TypeCode.INT,TypeName.LONG),
          new Add(TypeCode.LONG),
          new Convert(TypeCode.LONG,TypeName.INT),
          new Add(TypeCode.INT),
          new Return(TypeCode.INT)
          ) ;
      cd = cd.addMethod(md) ;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.