mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-18 14:58:47 +00:00
Fix for #91 Stateless Update API Change, #90 Removed BeanState.setReference(), #89 Remove support for multiple @Id properties
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user