Fin*_*arr 6 embedded hibernate embeddable
在拥有类:
...
@Embedded
private LatLon location;
...
Run Code Online (Sandbox Code Playgroud)
在引用的类中:
@Embeddable
public class LatLon implements Serializable {
private double lat;
private double lon;
...
}
Run Code Online (Sandbox Code Playgroud)
当我尝试使用null值保存拥有类的实例时LatLon:
org.hibernate.PropertyValueException: not-null property references a null or transient value: com.*.location.
如何在拥有类中允许此值为null?我试过制作它Nullable并没有效果.