Код: Выделить всё
WARNING [main] null.openjpa.Runtime Fields "com.barbeeloft.webapp.model.Employee.training" are not a default persistent type, and do not have any annotations indicating their persistence strategy. They will be treated as non-persistent. If you intended for these fields to be persistent, be sure to annotate them appropriately or declare them in orm.xml. Otherwise annotate them with @Transient.
Код: Выделить всё
@Converter(autoApply=true)
public class StringListConverter implements AttributeConverter {
private static final String SPLIT_CHAR = ";";
@Override
public String convertToDatabaseColumn( List list ) {
String s = list != null ? String.join( SPLIT_CHAR, list ) : "";
System.out.println("in convertToDatabaseColumn("+ s +")" );
return s;
};
@Override
public List convertToEntityAttribute( String string ) {
List l = string != null ? new ArrayList( Arrays.asList( string.split(SPLIT_CHAR)) ) : new ArrayList();
System.out.println( "in convertToEntityAttribute("+ l +")");
return l;
};
}
Код: Выделить всё
@Column(length=128,name="TRAINING",columnDefinition = "VARCHAR(128) NOT NULL")
@Convert(converter=StringListConverter.class,attributeName="training")
private List training = new ArrayList();
Попытка использовать autoApply, различные атрибуты @Column и атрибут атрибутаName, среди прочего.
Подробнее здесь: https://stackoverflow.com/questions/792 ... -persisted