Fix for #91 Stateless Update API Change, #90 Removed BeanState.setReference(), #89 Remove support for multiple @Id properties

This commit is contained in:
Rob Bygrave committed 2014-04-23 01:51:27 +12:00
1 parent 5e2d592c2a
commit 0d1c9e2883
66 files changed
+1045 -1768

No files matched your search

@@ -17,20 +17,17 @@ public class FactoryId {
*/
public BindableId createId(BeanDescriptor<?> desc) {
BeanProperty[] uids = desc.propertiesId();
if (uids.length == 0) {
BeanProperty id = desc.getIdProperty();
if (id == null) {
return new BindableIdEmpty();
} else if (uids.length == 1) {
if (!uids[0].isEmbedded()) {
return new BindableIdScalar(uids[0]);
}
if (!id.isEmbedded()) {
return new BindableIdScalar(id);
} else {
BeanPropertyAssocOne<?> embId = (BeanPropertyAssocOne<?>) uids[0];
return new BindableIdEmbedded(embId, desc);
}
} else {
return new BindableIdMap(uids, desc);
BeanPropertyAssocOne<?> embId = (BeanPropertyAssocOne<?>) id;
return new BindableIdEmbedded(embId, desc);
}
}
}