package org.apache.ojb.broker;
import java.util.*;
public class OneTable
{
    protected int oneId = 0;

    protected String name = null;

    protected Collection twos = new ArrayList(); 

    protected Collection children = new ArrayList(); 

    public int getOneId() {
        return oneId;
    }
    public void setOneId(int id) {
        this.oneId = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
   
    public Collection getTwos() {
        return twos;
    }
    public void addTwo(TwoTable two) {
        if (!this.twos.contains(two)) {
            this.twos.add(two);
            two.setOne(this);
        }
    }
    public void removeTwo(TwoTable two) { 
        boolean removed = this.twos.remove(two);
        if (removed) two.setOne(null);
    }
    public Collection getChildren() {
        return children;
    }
    public void addChild(Child child) {
        if (!this.children.contains(child)) {
            this.children.add(child);
            child.setOne(this);
        }
    }
    public void removeChild(Child child) { 
        boolean removed = this.children.remove(child);
        if (removed) child.setOne(null);
    } 
}
