org.nuiton.topia.it.mapping.test14.GeneratedB14CTopiaDao Maven / Gradle / Ivy
package org.nuiton.topia.it.mapping.test14;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import javax.annotation.Generated;
import org.nuiton.topia.it.mapping.AbstractTopiaItMappingTopiaDao;
import org.nuiton.topia.it.mapping.TopiaItMappingEntityEnum;
import org.nuiton.topia.persistence.TopiaDao;
import org.nuiton.topia.persistence.TopiaEntity;
import org.nuiton.topia.persistence.TopiaException;
import org.nuiton.topia.persistence.TopiaQueryBuilderAddCriteriaOrRunQueryStep;
@Generated(value = "org.nuiton.topia.templates.EntityDaoTransformer", date = "Thu Oct 13 17:59:14 CEST 2016")
public abstract class GeneratedB14CTopiaDao extends AbstractTopiaItMappingTopiaDao {
@Override
public Class getEntityClass() {
return (Class) B14C.class;
}
@Override
public TopiaItMappingEntityEnum getTopiaEntityEnum() {
return TopiaItMappingEntityEnum.B14C;
}
@Override
public void delete(E entity) {
if ( ! entity.isPersisted()) {
throw new IllegalArgumentException("entity " + entity + " is not persisted, you can't delete it");
}
super.delete(entity);
}
public TopiaQueryBuilderAddCriteriaOrRunQueryStep forA14CIn(Collection v) {
TopiaQueryBuilderAddCriteriaOrRunQueryStep result = forIn(B14C.PROPERTY_A14_CASSOC14_C + '.' + Assoc14C.PROPERTY_A14_C, (Collection) v);
return result;
}
public TopiaQueryBuilderAddCriteriaOrRunQueryStep forA14CEquals(A14C v) {
TopiaQueryBuilderAddCriteriaOrRunQueryStep result = forEquals(B14C.PROPERTY_A14_CASSOC14_C + '.' + Assoc14C.PROPERTY_A14_C, v);
return result;
}
@Deprecated
public E findByA14C(A14C v) {
return forA14CEquals(v).findAnyOrNull();
}
@Deprecated
public List findAllByA14C(A14C v) {
return forA14CEquals(v).findAll();
}
public E findByAssoc14C(Assoc14C value) {
E result = forProperties(B14C.PROPERTY_A14_CASSOC14_C, value).findAnyOrNull();
return result;
}
public List findAllByAssoc14C(Assoc14C value) {
List result = forProperties(B14C.PROPERTY_A14_CASSOC14_C, value).findAll();
return result;
}
@Override
public List findUsages(Class type, E entity) {
return new LinkedList();
}
@Override
public Map, List extends TopiaEntity>> findAllUsages(E entity) {
return new HashMap, List extends TopiaEntity>>();
}
@Override
public List getAggregate(E entity) throws TopiaException {
List tmp = new ArrayList();
// pour tous les attributs rechecher les composites et les class d'asso
// on les ajoute dans tmp
// on refait un tour sur chaque entity de tmp pour recuperer leur
// composite
List result = new ArrayList();
for (TopiaEntity e : tmp) {
result.add(e);
TopiaDao dao = (TopiaDao) topiaDaoSupplier.getDao(e.getClass());
result.addAll(dao.getAggregate(e));
}
return result;
}
@Override
public List getComposite(E entity) throws TopiaException {
List tmp = new ArrayList();
// pour tous les attributs rechecher les composites et les class d'asso
// on les ajoute dans tmp
B14CAbstract entityAbstract = (B14CAbstract)entity;
if (entityAbstract.a14CAssoc14C != null) {
tmp.add(entityAbstract.a14CAssoc14C);
}
// on refait un tour sur chaque entity de tmp pour recuperer leur
// composite
List result = new ArrayList();
for (TopiaEntity e : tmp) {
if (e != null) {
result.add(e);
TopiaDao dao = (TopiaDao) topiaDaoSupplier.getDao(e.getClass());
result.addAll(dao.getComposite(e));
}
}
return result;
}
} //GeneratedB14CTopiaDao
© 2015 - 2024 Weber Informatics LLC | Privacy Policy