mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-18 14:58:47 +00:00
Remove underlying Scala support
This commit is contained in:
1 parent
72ae11046e
commit
0e5157969d
18 files changed
+615
-956
No files matched your search
@@ -729,8 +729,8 @@ public final class DefaultPersister implements Persister {
|
||||
this.updateNullProperties = false;
|
||||
}
|
||||
|
||||
private Object getValueUnderlying() {
|
||||
return many.getValueUnderlying(parentBean);
|
||||
private Object getValue() {
|
||||
return many.getValue(parentBean);
|
||||
}
|
||||
|
||||
private boolean isModifyListenMode() {
|
||||
@@ -794,7 +794,7 @@ public final class DefaultPersister implements Persister {
|
||||
|
||||
private void removeAssocManyPrivateOwned(SaveManyPropRequest saveMany) {
|
||||
|
||||
Object details = saveMany.getValueUnderlying();
|
||||
Object details = saveMany.getValue();
|
||||
|
||||
// check that the list is not null and if it is a BeanCollection
|
||||
// check that is has been populated (don't trigger lazy loading)
|
||||
@@ -822,7 +822,7 @@ public final class DefaultPersister implements Persister {
|
||||
|
||||
BeanPropertyAssocMany<?> prop = saveMany.getMany();
|
||||
|
||||
Object details = saveMany.getValueUnderlying();
|
||||
Object details = saveMany.getValue();
|
||||
|
||||
// check that the list is not null and if it is a BeanCollection
|
||||
// check that is has been populated (don't trigger lazy loading)
|
||||
@@ -989,7 +989,7 @@ public final class DefaultPersister implements Persister {
|
||||
private void saveAssocManyIntersection(SaveManyPropRequest saveManyPropRequest, boolean deleteMissingChildren) {
|
||||
|
||||
BeanPropertyAssocMany<?> prop = saveManyPropRequest.getMany();
|
||||
Object value = prop.getValueUnderlying(saveManyPropRequest.getParentBean());
|
||||
Object value = prop.getValue(saveManyPropRequest.getParentBean());
|
||||
if (value == null) {
|
||||
return;
|
||||
}
|
||||
@@ -1126,7 +1126,7 @@ public final class DefaultPersister implements Persister {
|
||||
|
||||
if (ModifyListenMode.REMOVALS.equals(manys[i].getModifyListenMode())) {
|
||||
// PrivateOwned ...
|
||||
Object details = manys[i].getValueUnderlying(parentBean);
|
||||
Object details = manys[i].getValue(parentBean);
|
||||
if (details instanceof BeanCollection<?>) {
|
||||
Set<?> modifyRemovals = ((BeanCollection<?>) details).getModifyRemovals();
|
||||
if (modifyRemovals != null && !modifyRemovals.isEmpty()) {
|
||||
|
||||
@@ -1,34 +1,23 @@
|
||||
package com.avaje.ebeaninternal.server.persist;
|
||||
|
||||
import com.avaje.ebeaninternal.server.deploy.parse.DetectScala;
|
||||
|
||||
/**
|
||||
* Utility object with helper methods for DML.
|
||||
*/
|
||||
public class DmlUtil {
|
||||
|
||||
private static final boolean hasScalaSupport = DetectScala.hasScalaSupport();
|
||||
|
||||
/**
|
||||
* Return true if the value is null or a Numeric 0 (for primitive int's and long's) or Option empty.
|
||||
*/
|
||||
public static boolean isNullOrZero(Object value){
|
||||
if (value == null){
|
||||
return true;
|
||||
}
|
||||
|
||||
if (value instanceof Number){
|
||||
return ((Number)value).longValue() == 0l;
|
||||
}
|
||||
|
||||
if (hasScalaSupport){
|
||||
if (value instanceof scala.Option<?>) {
|
||||
if (((scala.Option<?>) value).isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
package com.avaje.ebeaninternal.server.persist;
|
||||
|
||||
|
||||
/**
|
||||
* Utility object with helper methods for DML.
|
||||
*/
|
||||
public class DmlUtil {
|
||||
|
||||
/**
|
||||
* Return true if the value is null or a Numeric 0 (for primitive int's and long's) or Option empty.
|
||||
*/
|
||||
public static boolean isNullOrZero(Object value){
|
||||
if (value == null){
|
||||
return true;
|
||||
}
|
||||
|
||||
if (value instanceof Number){
|
||||
return ((Number)value).longValue() == 0l;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user