initial rework for new enhancement

This commit is contained in:
Robin Bygrave
2013-06-19 20:36:24 +12:00
parent eb1eafe98c
commit 4ec62a5772
193 changed files with 2737 additions and 5285 deletions
@@ -10,6 +10,7 @@ import com.avaje.ebean.Transaction;
import com.avaje.ebean.bean.BeanCollection;
import com.avaje.ebean.bean.BeanCollectionAdd;
import com.avaje.ebean.bean.BeanCollectionLoader;
import com.avaje.ebean.bean.EntityBean;
import com.avaje.ebean.common.BeanSet;
import com.avaje.ebeaninternal.server.text.json.WriteJsonContext;
@@ -72,12 +73,12 @@ public final class BeanSetHelp<T> implements BeanCollectionHelp<T> {
this.set = set;
}
public void addBean(Object bean) {
public void addBean(EntityBean bean) {
set.add(bean);
}
}
public void add(BeanCollection<?> collection, Object bean) {
public void add(BeanCollection<?> collection, EntityBean bean) {
collection.internalAdd(bean);
}
@@ -85,18 +86,18 @@ public final class BeanSetHelp<T> implements BeanCollectionHelp<T> {
return vanilla ? new LinkedHashSet<T>() : new BeanSet<T>();
}
public BeanCollection<T> createReference(Object parentBean, String propertyName) {
public BeanCollection<T> createReference(EntityBean parentBean, String propertyName) {
return new BeanSet<T>(loader, parentBean, propertyName);
}
public void refresh(EbeanServer server, Query<?> query, Transaction t, Object parentBean) {
public void refresh(EbeanServer server, Query<?> query, Transaction t, EntityBean parentBean) {
BeanSet<?> newBeanSet = (BeanSet<?>)server.findSet(query, t);
refresh(newBeanSet, parentBean);
}
public void refresh(BeanCollection<?> bc, Object parentBean) {
public void refresh(BeanCollection<?> bc, EntityBean parentBean) {
BeanSet<?> newBeanSet = (BeanSet<?>)bc;
@@ -146,7 +147,7 @@ public final class BeanSetHelp<T> implements BeanCollectionHelp<T> {
if (count++ > 0){
ctx.appendComma();
}
targetDescriptor.jsonWrite(ctx, detailBean);
targetDescriptor.jsonWrite(ctx, (EntityBean)detailBean);
}
ctx.endAssocMany();
}