this.mappingColumn.setCustomRead( readExpression );
/** * Shallow copy, the value is not copied */ @Override public Column clone() { Column copy = new Column(); copy.setLength( length ); copy.setScale( scale ); copy.setValue( value ); copy.setTypeIndex( typeIndex ); copy.setName( getQuotedName() ); copy.setNullable( nullable ); copy.setPrecision( precision ); copy.setUnique( unique ); copy.setSqlType( sqlType ); copy.setSqlTypeCode( sqlTypeCode ); copy.uniqueInteger = uniqueInteger; //usually useless copy.setCheckConstraint( checkConstraint ); copy.setComment( comment ); copy.setDefaultValue( defaultValue ); copy.setCustomRead( customRead ); copy.setCustomWrite( customWrite ); return copy; }
column.setCustomRead( columnSource.getReadFragment() ); column.setCustomWrite( columnSource.getWriteFragment() );
public static void bindColumn(Element node, Column column, boolean isNullable) throws MappingException { Attribute lengthNode = node.attribute( "length" ); if ( lengthNode != null ) column.setLength( Integer.parseInt( lengthNode.getValue() ) ); Attribute scalNode = node.attribute( "scale" ); if ( scalNode != null ) column.setScale( Integer.parseInt( scalNode.getValue() ) ); Attribute precNode = node.attribute( "precision" ); if ( precNode != null ) column.setPrecision( Integer.parseInt( precNode.getValue() ) ); Attribute nullNode = node.attribute( "not-null" ); column.setNullable( nullNode == null ? isNullable : nullNode.getValue().equals( "false" ) ); Attribute unqNode = node.attribute( "unique" ); if ( unqNode != null ) column.setUnique( unqNode.getValue().equals( "true" ) ); column.setCheckConstraint( node.attributeValue( "check" ) ); column.setDefaultValue( node.attributeValue( "default" ) ); Attribute typeNode = node.attribute( "sql-type" ); if ( typeNode != null ) column.setSqlType( typeNode.getValue() ); String customWrite = node.attributeValue( "write" ); if(customWrite != null && !customWrite.matches("[^?]*\\?[^?]*")) { throw new MappingException("write expression must contain exactly one value placeholder ('?') character"); } column.setCustomWrite( customWrite ); column.setCustomRead( node.attributeValue( "read" ) ); Element comment = node.element("comment"); if (comment!=null) column.setComment( comment.getTextTrim() ); }
public static void bindColumn(Element node, Column column, boolean isNullable) throws MappingException { Attribute lengthNode = node.attribute( "length" ); if ( lengthNode != null ) column.setLength( Integer.parseInt( lengthNode.getValue() ) ); Attribute scalNode = node.attribute( "scale" ); if ( scalNode != null ) column.setScale( Integer.parseInt( scalNode.getValue() ) ); Attribute precNode = node.attribute( "precision" ); if ( precNode != null ) column.setPrecision( Integer.parseInt( precNode.getValue() ) ); Attribute nullNode = node.attribute( "not-null" ); column.setNullable( nullNode == null ? isNullable : nullNode.getValue().equals( "false" ) ); Attribute unqNode = node.attribute( "unique" ); if ( unqNode != null ) column.setUnique( unqNode.getValue().equals( "true" ) ); column.setCheckConstraint( node.attributeValue( "check" ) ); column.setDefaultValue( node.attributeValue( "default" ) ); Attribute typeNode = node.attribute( "sql-type" ); if ( typeNode != null ) column.setSqlType( typeNode.getValue() ); String customWrite = node.attributeValue( "write" ); if(customWrite != null && !customWrite.matches("[^?]*\\?[^?]*")) { throw new MappingException("write expression must contain exactly one value placeholder ('?') character"); } column.setCustomWrite( customWrite ); column.setCustomRead( node.attributeValue( "read" ) ); Element comment = node.element("comment"); if (comment!=null) column.setComment( comment.getTextTrim() ); }
this.mappingColumn.setCustomRead( readExpression );
this.mappingColumn.setCustomRead( readExpression );
this.mappingColumn.setCustomRead( readExpression );
/** * Shallow copy, the value is not copied */ @Override public Column clone() { Column copy = new Column( name, unique ); copy.setTableName( tableName ); copy.setLength( length ); copy.setScale( scale ); copy.setNullable( nullable ); copy.setPrecision( precision ); copy.setSqlType( sqlType ); copy.setUniqueInteger( uniqueInteger ); //usually useless copy.setCheckConstraint( checkConstraint ); copy.setComment( comment ); copy.setDefaultValue( defaultValue ); copy.setCustomRead( customRead ); copy.setCustomWrite( customWrite ); copy.setSqlTypeDescriptorAccess( sqlTypeDescriptorAccess ); copy.setJavaTypeMapping( javaTypeMapping ); return copy; }
column.setComment(cc.getComment()); column.setDefaultValue(cc.getDefaultValue()); column.setCustomRead(cc.getRead()); column.setCustomWrite(cc.getWrite());
/** * Shallow copy, the value is not copied */ protected Object clone() { Column copy = new Column(); copy.setLength( length ); copy.setScale( scale ); copy.setValue( value ); copy.setTypeIndex( typeIndex ); copy.setName( getQuotedName() ); copy.setNullable( nullable ); copy.setPrecision( precision ); copy.setUnique( unique ); copy.setSqlType( sqlType ); copy.setSqlTypeCode( sqlTypeCode ); copy.uniqueInteger = uniqueInteger; //usually useless copy.setCheckConstraint( checkConstraint ); copy.setComment( comment ); copy.setDefaultValue( defaultValue ); copy.setCustomRead( customRead ); copy.setCustomWrite( customWrite ); return copy; }
/** * Shallow copy, the value is not copied */ protected Object clone() { Column copy = new Column(); copy.setLength( length ); copy.setScale( scale ); copy.setValue( value ); copy.setTypeIndex( typeIndex ); copy.setName( getQuotedName() ); copy.setNullable( nullable ); copy.setPrecision( precision ); copy.setUnique( unique ); copy.setSqlType( sqlType ); copy.setSqlTypeCode( sqlTypeCode ); copy.uniqueInteger = uniqueInteger; //usually useless copy.setCheckConstraint( checkConstraint ); copy.setComment( comment ); copy.setDefaultValue( defaultValue ); copy.setCustomRead( customRead ); copy.setCustomWrite( customWrite ); return copy; }
column.setCustomRead( columnSource.getReadFragment() ); column.setCustomWrite( columnSource.getWriteFragment() );