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

org.nuiton.topia.it.mapping.test3.B33Abstract 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 B33Abstract extends AbstractTopiaEntity implements B33 {

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

    private static final long serialVersionUID = 7221066139914679344L;

    @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_ROLE_A33, Collection.class, A33.class, roleA33);
    }

    @Override
    public void addRoleA33(A33 roleA33) {
        if (this.roleA33 == null) {
            this.roleA33 = new LinkedList();
        }
        if (roleA33.getRoleB33() == null) {
            roleA33.setRoleB33(new java.util.LinkedList());
        }
        roleA33.getRoleB33().add(this);
        this.roleA33.add(roleA33);
    }

    @Override
    public void addAllRoleA33(Iterable roleA33) {
        if (roleA33 == null) {
            return;
        }
        for (A33 item : roleA33) {
            addRoleA33(item);
        }
    }

    @Override
    public void setRoleA33(Collection roleA33) {
        this.roleA33 = roleA33;
    }

    @Override
    public void removeRoleA33(A33 roleA33) {
        if (this.roleA33 == null || !this.roleA33.remove(roleA33)) {
            throw new IllegalArgumentException("List does not contain given element");
        }
        roleA33.getRoleB33().remove(this);
    }

    @Override
    public void clearRoleA33() {
        if (this.roleA33 == null) {
            return;
        }
        for (A33 item : this.roleA33) {
            item.getRoleB33().remove(this);
        }
        this.roleA33.clear();
    }

    @Override
    public Collection getRoleA33() {
        return roleA33;
    }

    @Override
    public A33 getRoleA33ByTopiaId(String topiaId) {
        return TopiaEntityHelper.getEntityByTopiaId(roleA33, topiaId);
    }

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

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

    @Override
    public boolean isRoleA33Empty() {
        int size = sizeRoleA33();
        return size == 0;
    }

    @Override
    public boolean isRoleA33NotEmpty() {
        boolean empty = isRoleA33Empty();
        return ! empty;
    }

    @Override
    public boolean containsRoleA33(A33 roleA33) {
        boolean contains = this.roleA33 !=null && this.roleA33.contains(roleA33);
        return contains;
    }

} //B33Abstract




© 2015 - 2024 Weber Informatics LLC | Privacy Policy