org.nuiton.topia.it.mapping.test1.A12Abstract Maven / Gradle / Ivy
package org.nuiton.topia.it.mapping.test1;
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 A12Abstract extends AbstractTopiaEntity implements A12 {
/**
* Nom de l'attribut en BD : b12
*/
protected Collection b12;
private static final long serialVersionUID = 3617287947925283938L;
@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_B12, Collection.class, B12.class, b12);
}
@Override
public void addB12(B12 b12) {
if (this.b12 == null) {
this.b12 = new LinkedList();
}
b12.setA12(this);
this.b12.add(b12);
}
@Override
public void addAllB12(Iterable b12) {
if (b12 == null) {
return;
}
for (B12 item : b12) {
addB12(item);
}
}
@Override
public void setB12(Collection b12) {
this.b12 = b12;
}
@Override
public void removeB12(B12 b12) {
if (this.b12 == null || !this.b12.remove(b12)) {
throw new IllegalArgumentException("List does not contain given element");
}
b12.setA12(null);
}
@Override
public void clearB12() {
if (this.b12 == null) {
return;
}
for (B12 item : this.b12) {
item.setA12(null);
}
this.b12.clear();
}
@Override
public Collection getB12() {
return b12;
}
@Override
public B12 getB12ByTopiaId(String topiaId) {
return TopiaEntityHelper.getEntityByTopiaId(b12, topiaId);
}
@Override
public Collection getB12TopiaIds() {
Collection topiaIds = new LinkedList();
Collection tmp = getB12();
if (tmp != null) {
for (TopiaEntity topiaEntity : tmp) {
topiaIds.add(topiaEntity.getTopiaId());
}
}
return topiaIds;
}
@Override
public int sizeB12() {
if (b12 == null) {
return 0;
}
return b12.size();
}
@Override
public boolean isB12Empty() {
int size = sizeB12();
return size == 0;
}
@Override
public boolean isB12NotEmpty() {
boolean empty = isB12Empty();
return ! empty;
}
@Override
public boolean containsB12(B12 b12) {
boolean contains = this.b12 !=null && this.b12.contains(b12);
return contains;
}
} //A12Abstract
© 2015 - 2024 Weber Informatics LLC | Privacy Policy