mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-18 14:58:47 +00:00
WIP update api
This commit is contained in:
1 parent
96e4b4640f
commit
f7a37537db
20 files changed
+41
-122
No files matched your search
@@ -74,6 +74,7 @@ import com.avaje.ebeaninternal.server.type.TypeManager;
|
||||
import com.avaje.ebeaninternal.util.SortByClause;
|
||||
import com.avaje.ebeaninternal.util.SortByClause.Property;
|
||||
import com.avaje.ebeaninternal.util.SortByClauseParser;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -955,7 +956,7 @@ public class BeanDescriptor<T> implements MetaBeanInfo {
|
||||
Collection<?> actualDetails = bc.getActualDetails();
|
||||
for (Object bean : actualDetails) {
|
||||
// Collect the id values
|
||||
idList.add(targetDescriptor.getId(bean));
|
||||
idList.add(targetDescriptor.getId((EntityBean)bean));
|
||||
}
|
||||
CachedManyIds ids = new CachedManyIds(idList);
|
||||
cachePutCachedManyIds(parentId, many.getName(), ids);
|
||||
@@ -1345,7 +1346,7 @@ public class BeanDescriptor<T> implements MetaBeanInfo {
|
||||
* Create a reference bean based on the id.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public T createReference(Boolean readOnly, Object id, Object parent) {
|
||||
public T createReference(Boolean readOnly, Object id) {//, Object parent) {
|
||||
|
||||
if (cacheSharableBeans && !Boolean.FALSE.equals(readOnly)) {
|
||||
CachedBeanData d = (CachedBeanData) getBeanCache().get(id);
|
||||
@@ -2355,11 +2356,6 @@ public class BeanDescriptor<T> implements MetaBeanInfo {
|
||||
return localDescriptor.jsonReadObject(ctx, path);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private T createJsonBean() {
|
||||
return (T)createEntityBean();
|
||||
}
|
||||
|
||||
private ReadBeanState jsonReadObject(ReadJsonContext ctx, String path) {
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ public final class BeanMapHelp<T> implements BeanCollectionHelp<T> {
|
||||
return beanMap;
|
||||
}
|
||||
|
||||
public void refresh(EbeanServer server, Query<?> query, Transaction t, Object parentBean) {
|
||||
public void refresh(EbeanServer server, Query<?> query, Transaction t, EntityBean parentBean) {
|
||||
BeanMap<?, ?> newBeanMap = (BeanMap<?, ?>) server.findMap(query, t);
|
||||
refresh(newBeanMap, parentBean);
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> {
|
||||
/**
|
||||
* Add the bean to the appropriate collection on the parent bean.
|
||||
*/
|
||||
public void addBeanToCollectionWithCreate(Object parentBean, Object detailBean) {
|
||||
public void addBeanToCollectionWithCreate(EntityBean parentBean, EntityBean detailBean) {
|
||||
BeanCollection<?> bc = (BeanCollection<?>)super.getValue(parentBean);
|
||||
if (bc == null) {
|
||||
bc = (BeanCollection<?>)help.createEmpty(false);
|
||||
@@ -507,7 +507,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> {
|
||||
for (int i=0; i < parentIds.size(); i++) {
|
||||
for (int y = 0; y < exportedProperties.length; y++) {
|
||||
Object compId = parentIds.get(i);
|
||||
expandedList.add(exportedProperties[y].getValue(compId));
|
||||
expandedList.add(exportedProperties[y].getValue((EntityBean)compId));
|
||||
}
|
||||
}
|
||||
return expandedList;
|
||||
|
||||
@@ -83,7 +83,7 @@ public interface IdBinder {
|
||||
/**
|
||||
* Return the id values for a given bean.
|
||||
*/
|
||||
public Object[] getIdValues(Object bean);
|
||||
public Object[] getIdValues(EntityBean bean);
|
||||
|
||||
/**
|
||||
* Build a string of the logical expressions.
|
||||
@@ -131,7 +131,7 @@ public interface IdBinder {
|
||||
* Read the id value from the result set and set it to the bean also returning
|
||||
* it.
|
||||
*/
|
||||
public Object readSet(DbReadContext ctx, Object bean) throws SQLException;
|
||||
public Object readSet(DbReadContext ctx, EntityBean bean) throws SQLException;
|
||||
|
||||
/**
|
||||
* Ignore the appropriate number of scalar properties for this id.
|
||||
|
||||
@@ -92,7 +92,7 @@ public final class IdBinderEmpty implements IdBinder {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Object[] getIdValues(Object bean) {
|
||||
public Object[] getIdValues(EntityBean bean) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public final class IdBinderEmpty implements IdBinder {
|
||||
public void loadIgnore(DbReadContext ctx) {
|
||||
}
|
||||
|
||||
public Object readSet(DbReadContext ctx, Object bean) throws SQLException {
|
||||
public Object readSet(DbReadContext ctx, EntityBean bean) throws SQLException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ public final class IdBinderEmpty implements IdBinder {
|
||||
public void appendSelect(DbSqlContext ctx, boolean subQuery) {
|
||||
}
|
||||
|
||||
public Object convertSetId(Object idValue, Object bean) {
|
||||
public Object convertSetId(Object idValue, EntityBean bean) {
|
||||
return idValue;
|
||||
}
|
||||
|
||||
@@ -131,6 +131,6 @@ public final class IdBinderEmpty implements IdBinder {
|
||||
}
|
||||
|
||||
public void writeData(DataOutput dataOutput, Object idValue) throws IOException {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user