【发布时间】:2011-03-23 16:33:52
【问题描述】:
在所属类中:
...
@Embedded
private LatLon location;
...
在引用的类中:
@Embeddable
public class LatLon implements Serializable {
private double lat;
private double lon;
...
}
当我尝试使用 LatLon 的空值保存所属类的实例时:
org.hibernate.PropertyValueException: not-null property references a null or transient value: com.*.location.
我可以做些什么来让这个值在所属类中为空?我尝试将其设为Nullable,但没有任何效果。
【问题讨论】:
标签: hibernate embedded embeddable