@Test( expected = IllegalArgumentException.class ) public void convertToEntityAttributeInvalidCode() { converter.convertToEntityAttribute( "COD:678" ); }
@Override public Reference convertToEntityAttribute( String dbData ) { if ( dbData == null ) { return null; } final int index = dbData.indexOf( SEPARATOR ); if ( (index <= 0) || (index + 1 == dbData.length()) ) { throw new IllegalArgumentException( "Reference does not include required separator: " + dbData ); } return new Reference( dbData.substring( index + 1 ), NameUtils.toEnumValue( ReferenceType.class, dbData.substring( 0, index ) ) ); }
ReferenceAttributeConverter implements AttributeConverter<Reference, String> { @Override public Reference convertToEntityAttribute( String dbData ) { if ( dbData == null ) { return null; } final int index = dbData.indexOf( SEPARATOR ); if ( (index <= 0) || (index + 1 == dbData.length()) ) { throw new IllegalArgumentException( "Reference does not include required separator: " + dbData ); } return new Reference( dbData.substring( index + 1 ), NameUtils.toEnumValue( ReferenceType.class, dbData.substring( 0, index ) ) ); } }
ReferenceAttributeConverter implements AttributeConverter<Reference, String> { @Override public Reference convertToEntityAttribute( String dbData ) { if ( dbData == null ) { return null; } final int index = dbData.indexOf( SEPARATOR ); if ( (index <= 0) || (index + 1 == dbData.length()) ) { throw new IllegalArgumentException( "Reference does not include required separator: " + dbData ); } return new Reference( dbData.substring( index + 1 ), NameUtils.toEnumValue( ReferenceType.class, dbData.substring( 0, index ) ) ); }  }
ReferenceAttributeConverter implements AttributeConverter<Reference, String> { @Override public Reference convertToEntityAttribute( String dbData ) { if ( dbData == null ) { return null; } final int index = dbData.indexOf( SEPARATOR ); if ( (index <= 0) || (index + 1 == dbData.length()) ) { throw new IllegalArgumentException( "Reference does not include required separator: " + dbData ); } return new Reference( dbData.substring( index + 1 ), NameUtils.toEnumValue( ReferenceType.class, dbData.substring( 0, index ) ) ); }  @Override String convertToDatabaseColumn( Reference attribute ); @Override Reference convertToEntityAttribute( String dbData ); }
ReferenceAttributeConverter implements AttributeConverter<Reference, String> { @Override public Reference convertToEntityAttribute( String dbData ) { if ( dbData == null ) { return null; } final int index = dbData.indexOf( SEPARATOR ); if ( (index <= 0) || (index + 1 == dbData.length()) ) { throw new IllegalArgumentException( "Reference does not include required separator: " + dbData ); } return new Reference( dbData.substring( index + 1 ), NameUtils.toEnumValue( ReferenceType.class, dbData.substring( 0, index ) ) ); }  @Override String convertToDatabaseColumn( Reference attribute ); @Override Reference convertToEntityAttribute( String dbData ); static final String SEPARATOR; }