All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nuiton.topia.it.mapping.test13.GeneratedA13ATopiaDao Maven / Gradle / Ivy

There is a newer version: 4.0
Show newest version
package org.nuiton.topia.it.mapping.test13;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
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;
import org.nuiton.topia.persistence.TopiaQueryBuilderRunQueryWithUniqueResultStep;

@Generated(value = "org.nuiton.topia.templates.EntityDaoTransformer", date = "Thu Oct 13 17:59:14 CEST 2016")
public abstract class GeneratedA13ATopiaDao extends AbstractTopiaItMappingTopiaDao {

    @Override
    public Class getEntityClass() {
        return (Class) A13A.class;
    }

    @Override
    public TopiaItMappingEntityEnum getTopiaEntityEnum() {
        return TopiaItMappingEntityEnum.A13A;
    }

    @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);
    }

    @Deprecated
    public E findByNaturalId(Integer naturalIdInteger, String naturalIdString, Date naturalIdDate) {
        return forNaturalId(naturalIdInteger, naturalIdString, naturalIdDate).findUnique();
    }

    @Deprecated
    public boolean existByNaturalId(Integer naturalIdInteger, String naturalIdString, Date naturalIdDate) {
        return forNaturalId(naturalIdInteger, naturalIdString, naturalIdDate).exists();
    }

    public E createByNaturalId(Integer naturalIdInteger, String naturalIdString, Date naturalIdDate) {
        return create(A13A.PROPERTY_NATURAL_ID_INTEGER, naturalIdInteger, A13A.PROPERTY_NATURAL_ID_STRING, naturalIdString, A13A.PROPERTY_NATURAL_ID_DATE, naturalIdDate);
    }

    public TopiaQueryBuilderRunQueryWithUniqueResultStep forNaturalId(Integer naturalIdInteger, String naturalIdString, Date naturalIdDate) {
        return forProperties(A13A.PROPERTY_NATURAL_ID_INTEGER, naturalIdInteger, A13A.PROPERTY_NATURAL_ID_STRING, naturalIdString, A13A.PROPERTY_NATURAL_ID_DATE, naturalIdDate);
    }

    public E createByNotNull(Integer naturalIdInteger, String naturalIdString, Date naturalIdDate) {
        return create(A13A.PROPERTY_NATURAL_ID_INTEGER, naturalIdInteger, A13A.PROPERTY_NATURAL_ID_STRING, naturalIdString, A13A.PROPERTY_NATURAL_ID_DATE, naturalIdDate);
    }

    public TopiaQueryBuilderAddCriteriaOrRunQueryStep forNaturalIdIntegerIn(Collection v) {
        TopiaQueryBuilderAddCriteriaOrRunQueryStep result = forIn(A13A.PROPERTY_NATURAL_ID_INTEGER, (Collection) v);
        return result;
    }

    public TopiaQueryBuilderAddCriteriaOrRunQueryStep forNaturalIdIntegerEquals(Integer v) {
        TopiaQueryBuilderAddCriteriaOrRunQueryStep result = forEquals(A13A.PROPERTY_NATURAL_ID_INTEGER, v);
        return result;
    }

    @Deprecated
    public E findByNaturalIdInteger(Integer v) {
        return forNaturalIdIntegerEquals(v).findAnyOrNull();
    }

    @Deprecated
    public List findAllByNaturalIdInteger(Integer v) {
        return forNaturalIdIntegerEquals(v).findAll();
    }

    public TopiaQueryBuilderAddCriteriaOrRunQueryStep forNaturalIdStringIn(Collection v) {
        TopiaQueryBuilderAddCriteriaOrRunQueryStep result = forIn(A13A.PROPERTY_NATURAL_ID_STRING, (Collection) v);
        return result;
    }

    public TopiaQueryBuilderAddCriteriaOrRunQueryStep forNaturalIdStringEquals(String v) {
        TopiaQueryBuilderAddCriteriaOrRunQueryStep result = forEquals(A13A.PROPERTY_NATURAL_ID_STRING, v);
        return result;
    }

    @Deprecated
    public E findByNaturalIdString(String v) {
        return forNaturalIdStringEquals(v).findAnyOrNull();
    }

    @Deprecated
    public List findAllByNaturalIdString(String v) {
        return forNaturalIdStringEquals(v).findAll();
    }

    public TopiaQueryBuilderAddCriteriaOrRunQueryStep forNaturalIdDateIn(Collection v) {
        TopiaQueryBuilderAddCriteriaOrRunQueryStep result = forIn(A13A.PROPERTY_NATURAL_ID_DATE, (Collection) v);
        return result;
    }

    public TopiaQueryBuilderAddCriteriaOrRunQueryStep forNaturalIdDateEquals(Date v) {
        TopiaQueryBuilderAddCriteriaOrRunQueryStep result = forEquals(A13A.PROPERTY_NATURAL_ID_DATE, v);
        return result;
    }

    @Deprecated
    public E findByNaturalIdDate(Date v) {
        return forNaturalIdDateEquals(v).findAnyOrNull();
    }

    @Deprecated
    public List findAllByNaturalIdDate(Date v) {
        return forNaturalIdDateEquals(v).findAll();
    }

    public TopiaQueryBuilderAddCriteriaOrRunQueryStep forIntegerFieldIn(Collection v) {
        TopiaQueryBuilderAddCriteriaOrRunQueryStep result = forIn(A13A.PROPERTY_INTEGER_FIELD, (Collection) v);
        return result;
    }

    public TopiaQueryBuilderAddCriteriaOrRunQueryStep forIntegerFieldEquals(Integer v) {
        TopiaQueryBuilderAddCriteriaOrRunQueryStep result = forEquals(A13A.PROPERTY_INTEGER_FIELD, v);
        return result;
    }

    @Deprecated
    public E findByIntegerField(Integer v) {
        return forIntegerFieldEquals(v).findAnyOrNull();
    }

    @Deprecated
    public List findAllByIntegerField(Integer v) {
        return forIntegerFieldEquals(v).findAll();
    }

    public TopiaQueryBuilderAddCriteriaOrRunQueryStep forStringsFieldContains(String v) {
        return forContains(A13A.PROPERTY_STRINGS_FIELD, v);
    }

    @Deprecated
    public E findContainsStringsField(String v) {
        return forStringsFieldContains(v).findAnyOrNull();
    }

    @Deprecated
    public List findAllContainsStringsField(String v) {
        return forStringsFieldContains(v).findAll();
    }

    public TopiaQueryBuilderAddCriteriaOrRunQueryStep forB13AContains(B13A v) {
        return forContains(A13A.PROPERTY_B13_A, v);
    }

    @Deprecated
    public E findContainsB13A(B13A v) {
        return forB13AContains(v).findAnyOrNull();
    }

    @Deprecated
    public List findAllContainsB13A(B13A v) {
        return forB13AContains(v).findAll();
    }

    public TopiaQueryBuilderAddCriteriaOrRunQueryStep forB13BIn(Collection v) {
        TopiaQueryBuilderAddCriteriaOrRunQueryStep result = forIn(A13A.PROPERTY_B13_B, (Collection) v);
        return result;
    }

    public TopiaQueryBuilderAddCriteriaOrRunQueryStep forB13BEquals(B13B v) {
        TopiaQueryBuilderAddCriteriaOrRunQueryStep result = forEquals(A13A.PROPERTY_B13_B, v);
        return result;
    }

    @Deprecated
    public E findByB13B(B13B v) {
        return forB13BEquals(v).findAnyOrNull();
    }

    @Deprecated
    public List findAllByB13B(B13B v) {
        return forB13BEquals(v).findAll();
    }

    public TopiaQueryBuilderAddCriteriaOrRunQueryStep forB13CContains(B13C v) {
        return forContains(A13A.PROPERTY_B13_C, v);
    }

    @Deprecated
    public E findContainsB13C(B13C v) {
        return forB13CContains(v).findAnyOrNull();
    }

    @Deprecated
    public List findAllContainsB13C(B13C v) {
        return forB13CContains(v).findAll();
    }

    @Override
    public  List findUsages(Class type, E entity) {
        return new LinkedList();
    }

    @Override
    public Map, List> findAllUsages(E entity) {
        return new HashMap, List>();
    }

    @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

        // 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;
    }

} //GeneratedA13ATopiaDao