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

org.nuiton.topia.it.mapping.test3.B32Abstract Maven / Gradle / Ivy

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

import java.util.Collection;
import java.util.LinkedList;
import javax.annotation.Generated;
import org.nuiton.topia.persistence.TopiaEntity;
import org.nuiton.topia.persistence.TopiaEntityVisitor;
import org.nuiton.topia.persistence.TopiaException;
import org.nuiton.topia.persistence.internal.AbstractTopiaEntity;
import org.nuiton.topia.persistence.util.TopiaEntityHelper;

@Generated(value = "org.nuiton.topia.templates.EntityTransformer", date = "Thu Oct 13 17:59:13 CEST 2016")
public abstract class B32Abstract extends AbstractTopiaEntity implements B32 {

    /**
     * Nom de l'attribut en BD : a32
     */
    protected Collection a32;

    private static final long serialVersionUID = 3833748802169495865L;

    @Override
    public void accept(TopiaEntityVisitor visitor) throws TopiaException {
        visitor.start(this);
        accept0(visitor);
        visitor.end(this);
    }

    protected void accept0(TopiaEntityVisitor visitor) throws TopiaException {
        visitor.visit(this, PROPERTY_A32, Collection.class, A32.class, a32);
    }

    @Override
    public void addA32(A32 a32) {
        if (this.a32 == null) {
            this.a32 = new LinkedList();
        }
        if (a32.getB32() == null) {
            a32.setB32(new java.util.LinkedList());
        }
        a32.getB32().add(this);
        this.a32.add(a32);
    }

    @Override
    public void addAllA32(Iterable a32) {
        if (a32 == null) {
            return;
        }
        for (A32 item : a32) {
            addA32(item);
        }
    }

    @Override
    public void setA32(Collection a32) {
        this.a32 = a32;
    }

    @Override
    public void removeA32(A32 a32) {
        if (this.a32 == null || !this.a32.remove(a32)) {
            throw new IllegalArgumentException("List does not contain given element");
        }
        a32.getB32().remove(this);
    }

    @Override
    public void clearA32() {
        if (this.a32 == null) {
            return;
        }
        for (A32 item : this.a32) {
            item.getB32().remove(this);
        }
        this.a32.clear();
    }

    @Override
    public Collection getA32() {
        return a32;
    }

    @Override
    public A32 getA32ByTopiaId(String topiaId) {
        return TopiaEntityHelper.getEntityByTopiaId(a32, topiaId);
    }

    @Override
    public Collection getA32TopiaIds() {
        Collection topiaIds = new LinkedList();
        Collection tmp = getA32();
        if (tmp != null) {
            for (TopiaEntity topiaEntity : tmp) {
                topiaIds.add(topiaEntity.getTopiaId());
            }
        }
        return topiaIds;
    }

    @Override
    public int sizeA32() {
        if (a32 == null) {
            return 0;
        }
        return a32.size();
    }

    @Override
    public boolean isA32Empty() {
        int size = sizeA32();
        return size == 0;
    }

    @Override
    public boolean isA32NotEmpty() {
        boolean empty = isA32Empty();
        return ! empty;
    }

    @Override
    public boolean containsA32(A32 a32) {
        boolean contains = this.a32 !=null && this.a32.contains(a32);
        return contains;
    }

} //B32Abstract




© 2015 - 2024 Weber Informatics LLC | Privacy Policy