org.nuiton.topia.it.mapping.test3.A3Abstract Maven / Gradle / Ivy
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 A3Abstract extends AbstractTopiaEntity implements A3 {
/**
* Nom de l'attribut en BD : b3
*/
protected Collection b3;
private static final long serialVersionUID = 3847027565457389880L;
@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_B3, Collection.class, B3.class, b3);
}
@Override
public void addB3(B3 b3) {
if (this.b3 == null) {
this.b3 = new LinkedList();
}
this.b3.add(b3);
}
@Override
public void addAllB3(Iterable b3) {
if (b3 == null) {
return;
}
for (B3 item : b3) {
addB3(item);
}
}
@Override
public void setB3(Collection b3) {
this.b3 = b3;
}
@Override
public void removeB3(B3 b3) {
if (this.b3 == null || !this.b3.remove(b3)) {
throw new IllegalArgumentException("List does not contain given element");
}
}
@Override
public void clearB3() {
if (this.b3 == null) {
return;
}
this.b3.clear();
}
@Override
public Collection getB3() {
return b3;
}
@Override
public B3 getB3ByTopiaId(String topiaId) {
return TopiaEntityHelper.getEntityByTopiaId(b3, topiaId);
}
@Override
public Collection getB3TopiaIds() {
Collection topiaIds = new LinkedList();
Collection tmp = getB3();
if (tmp != null) {
for (TopiaEntity topiaEntity : tmp) {
topiaIds.add(topiaEntity.getTopiaId());
}
}
return topiaIds;
}
@Override
public int sizeB3() {
if (b3 == null) {
return 0;
}
return b3.size();
}
@Override
public boolean isB3Empty() {
int size = sizeB3();
return size == 0;
}
@Override
public boolean isB3NotEmpty() {
boolean empty = isB3Empty();
return ! empty;
}
@Override
public boolean containsB3(B3 b3) {
boolean contains = this.b3 !=null && this.b3.contains(b3);
return contains;
}
} //A3Abstract
© 2015 - 2024 Weber Informatics LLC | Privacy Policy