private void extractDataFromPropertyData(PropertyData inferredData) { if ( inferredData != null ) { XProperty property = inferredData.getProperty(); if ( property != null ) { processExpression( property.getAnnotation( ColumnTransformer.class ) ); ColumnTransformers annotations = property.getAnnotation( ColumnTransformers.class ); if (annotations != null) { for ( ColumnTransformer annotation : annotations.value() ) { processExpression( annotation ); } } } } }
private void processExpression(ColumnTransformer annotation) { String nonNullLogicalColumnName = logicalColumnName != null ? logicalColumnName : ""; //use the default for annotations if ( annotation != null && ( StringHelper.isEmpty( annotation.forColumn() ) || annotation.forColumn().equals( nonNullLogicalColumnName ) ) ) { readExpression = annotation.read(); if ( StringHelper.isEmpty( readExpression ) ) { readExpression = null; } writeExpression = annotation.write(); if ( StringHelper.isEmpty( writeExpression ) ) { writeExpression = null; } } }
@Type(type="org.jadira.usertype.dateandtime.threeten.PersistentLocalDateTime") @Basic( optional = true ) @Column @ColumnTransformer( read="convert_from(dob_decrypt(dob),'UTF-8')", write="dob_encrypt(?)") public LocalDateTime getDob() { return this.dob; }
@Basic( optional = true ) @Column @ColumnTransformer( read="convert_from(ssn_decrypt(ssn),'UTF-8')", write="ssn_encrypt(?)") public String getSsn() { return this.ssn; }