Examples of convertToDatabaseColumn()


Examples of javax.persistence.AttributeConverter.convertToDatabaseColumn()

    if ( AttributeConverterTypeAdapter.class.isInstance( expectedType ) ) {
      final AttributeConverterTypeAdapter adapterType = (AttributeConverterTypeAdapter) expectedType;
      if ( getDataType().getReturnedClass().equals( adapterType.getModelType() ) ) {
        // apply the converter
        final AttributeConverter converter = ( (AttributeConverterTypeAdapter) expectedType ).getAttributeConverter();
        final Object converted = converter.convertToDatabaseColumn( getLiteralValue() );
        if ( isCharacterData( adapterType.sqlType() ) ) {
          setText( "'" + converted.toString() + "'" );
        }
        else {
          setText( converted.toString() );
View Full Code Here

Examples of javax.persistence.AttributeConverter.convertToDatabaseColumn()

                } else if (method.isAnnotationPresent(Convert.class)) {
                    Class<? extends AttributeConverter<?, ?>> converterClass = method.getAnnotation(Convert.class)
                            .converter();

                    AttributeConverter converter = converterClass.newInstance();
                    builder.append(converter.convertToDatabaseColumn(value));
                } else if (method.isAnnotationPresent(JoinColumn.class)) {
                    // We need to get the id of the joined object.
                    for (Method method2 : value.getClass().getMethods()) {
                        if (method2.isAnnotationPresent(Id.class)) {
                            builder.append(method2.invoke(value));
View Full Code Here

Examples of javax.persistence.AttributeConverter.convertToDatabaseColumn()

    if ( AttributeConverterTypeAdapter.class.isInstance( expectedType ) ) {
      final AttributeConverterTypeAdapter adapterType = (AttributeConverterTypeAdapter) expectedType;
      if ( getDataType().getReturnedClass().equals( adapterType.getModelType() ) ) {
        // apply the converter
        final AttributeConverter converter = ( (AttributeConverterTypeAdapter) expectedType ).getAttributeConverter();
        final Object converted = converter.convertToDatabaseColumn( getLiteralValue() );
        if ( isCharacterData( adapterType.sqlType() ) ) {
          setText( "'" + converted.toString() + "'" );
        }
        else {
          setText( converted.toString() );
View Full Code Here

Examples of javax.persistence.AttributeConverter.convertToDatabaseColumn()

                } else if (method.isAnnotationPresent(Convert.class)) {
                    Class<? extends AttributeConverter<?, ?>> converterClass = method.getAnnotation(Convert.class)
                            .converter();

                    AttributeConverter converter = converterClass.newInstance();
                    builder.append(converter.convertToDatabaseColumn(value));
                } else if (method.isAnnotationPresent(JoinColumn.class)) {
                    // We need to get the id of the joined object.
                    for (Method method2 : value.getClass().getMethods()) {
                        if (method2.isAnnotationPresent(Id.class)) {
                            builder.append(method2.invoke(value));
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.