You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great to support custom domain model types. Now with JPA you can define custom model property types, and a javax.persistence.Converter, for example for storing a joda-time Duration as a Long value:
import javax.persistence.AttributeConverter;
import javax.persistence.Converter;
import org.joda.time.Duration;
@Converter(autoApply = true)
public class DurationConverter implements AttributeConverter<Duration, Long>{
@Override
public Long convertToDatabaseColumn(Duration value) {
if(value!=null){
return value.getMillis();
}
return null;
}
@Override
public Duration convertToEntityAttribute(Long value) {
if(value!=null){
return Duration.millis(value);
}
return null;
}
}
It would be great to have some way of editing this type of fields. Detecting automatically JPA's converters I imagine it could be challenging, but maybe it could be achieved with something similar to FieldValueRenderer in formView.
The text was updated successfully, but these errors were encountered:
It would be great to support custom domain model types. Now with JPA you can define custom model property types, and a javax.persistence.Converter, for example for storing a joda-time Duration as a Long value:
It would be great to have some way of editing this type of fields. Detecting automatically JPA's converters I imagine it could be challenging, but maybe it could be achieved with something similar to FieldValueRenderer in formView.
The text was updated successfully, but these errors were encountered: