/*
 * This is autogenerated and should not be modified.
 * Any changes should be made to the super class.
 * Copyright: (c) Reinders Posters
 * Modified:  $Date$
 */

package nl.reinders.bm.generated;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.beans.PropertyVetoException;
import java.beans.VetoableChangeListener;
import java.beans.VetoableChangeSupport;

import javax.persistence.EntityManager;
import javax.persistence.MappedSuperclass;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.SequenceGenerator;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.FetchType;
import javax.persistence.CascadeType;
import javax.persistence.JoinColumn;
import javax.persistence.Query;
import javax.persistence.Transient;

/**
 * A JPA entity class for relation.
 * @version    $Revision$
 * @author     $Author$
 */
@MappedSuperclass
abstract public class Relation extends nl.reinders.bm.AbstractBean
implements java.io.Serializable
         , java.lang.Cloneable
         , Comparable<nl.reinders.bm.Relation>
{
	static final long serialVersionUID = 0;
	static final String SOURCECODE_VERSION = "$Revision$";
	static org.apache.log4j.Logger log4j = org.apache.log4j.Logger.getLogger(Relation.class.getName());

	// ===============================================================================================
	// RELATIONS OneToMany

	/** AddresssWhereIAmRelation*/
	public void addAddresssWhereIAmRelation(nl.reinders.bm.Address value)
	{
		if (value != null && !iAddresssWhereIAmRelation.contains(value))
		{
			iAddresssWhereIAmRelation.add(value);
			value.setRelation( (nl.reinders.bm.Relation)this);
		}
	}
	public void removeAddresssWhereIAmRelation(nl.reinders.bm.Address value)
	{
		if (value != null && iAddresssWhereIAmRelation.contains(value))
		{
			iAddresssWhereIAmRelation.remove(value);
			value.setRelation( (nl.reinders.bm.Relation)null );
		}
	}
	public java.util.List<nl.reinders.bm.Address> getAddresssWhereIAmRelation() { return iAddresssWhereIAmRelation; }
	@OneToMany(mappedBy = "iRelation", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Address.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Address> iAddresssWhereIAmRelation = new java.util.ArrayList<nl.reinders.bm.Address>();

	/** ArticlealiassWhereIAmRelation*/
	public void addArticlealiassWhereIAmRelation(nl.reinders.bm.Articlealias value)
	{
		if (value != null && !iArticlealiassWhereIAmRelation.contains(value))
		{
			iArticlealiassWhereIAmRelation.add(value);
			value.setRelation( (nl.reinders.bm.Relation)this);
		}
	}
	public void removeArticlealiassWhereIAmRelation(nl.reinders.bm.Articlealias value)
	{
		if (value != null && iArticlealiassWhereIAmRelation.contains(value))
		{
			iArticlealiassWhereIAmRelation.remove(value);
			value.setRelation( (nl.reinders.bm.Relation)null );
		}
	}
	public java.util.List<nl.reinders.bm.Articlealias> getArticlealiassWhereIAmRelation() { return iArticlealiassWhereIAmRelation; }
	@OneToMany(mappedBy = "iRelation", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Articlealias.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Articlealias> iArticlealiassWhereIAmRelation = new java.util.ArrayList<nl.reinders.bm.Articlealias>();

	/** BuyordersWhereIAmDeliveryRelation*/
	public void addBuyordersWhereIAmDeliveryRelation(nl.reinders.bm.Buyorder value)
	{
		if (value != null && !iBuyordersWhereIAmDeliveryRelation.contains(value))
		{
			iBuyordersWhereIAmDeliveryRelation.add(value);
			value.setDeliveryRelation( (nl.reinders.bm.Relation)this);
		}
	}
	public void removeBuyordersWhereIAmDeliveryRelation(nl.reinders.bm.Buyorder value)
	{
		if (value != null && iBuyordersWhereIAmDeliveryRelation.contains(value))
		{
			iBuyordersWhereIAmDeliveryRelation.remove(value);
			value.setDeliveryRelation( (nl.reinders.bm.Relation)null );
		}
	}
	public java.util.List<nl.reinders.bm.Buyorder> getBuyordersWhereIAmDeliveryRelation() { return iBuyordersWhereIAmDeliveryRelation; }
	@OneToMany(mappedBy = "iDeliveryRelation", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Buyorder.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Buyorder> iBuyordersWhereIAmDeliveryRelation = new java.util.ArrayList<nl.reinders.bm.Buyorder>();

	/** BuyordersWhereIAmRelation*/
	public void addBuyordersWhereIAmRelation(nl.reinders.bm.Buyorder value)
	{
		if (value != null && !iBuyordersWhereIAmRelation.contains(value))
		{
			iBuyordersWhereIAmRelation.add(value);
			value.setRelation( (nl.reinders.bm.Relation)this);
		}
	}
	public void removeBuyordersWhereIAmRelation(nl.reinders.bm.Buyorder value)
	{
		if (value != null && iBuyordersWhereIAmRelation.contains(value))
		{
			iBuyordersWhereIAmRelation.remove(value);
			value.setRelation( (nl.reinders.bm.Relation)null );
		}
	}
	public java.util.List<nl.reinders.bm.Buyorder> getBuyordersWhereIAmRelation() { return iBuyordersWhereIAmRelation; }
	@OneToMany(mappedBy = "iRelation", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Buyorder.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Buyorder> iBuyordersWhereIAmRelation = new java.util.ArrayList<nl.reinders.bm.Buyorder>();

	/** CalendarsWhereIAmRelation*/
	public void addCalendarsWhereIAmRelation(nl.reinders.bm.Calendar value)
	{
		if (value != null && !iCalendarsWhereIAmRelation.contains(value))
		{
			iCalendarsWhereIAmRelation.add(value);
			value.setRelation( (nl.reinders.bm.Relation)this);
		}
	}
	public void removeCalendarsWhereIAmRelation(nl.reinders.bm.Calendar value)
	{
		if (value != null && iCalendarsWhereIAmRelation.contains(value))
		{
			iCalendarsWhereIAmRelation.remove(value);
			value.setRelation( (nl.reinders.bm.Relation)null );
		}
	}
	public java.util.List<nl.reinders.bm.Calendar> getCalendarsWhereIAmRelation() { return iCalendarsWhereIAmRelation; }
	@OneToMany(mappedBy = "iRelation", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Calendar.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Calendar> iCalendarsWhereIAmRelation = new java.util.ArrayList<nl.reinders.bm.Calendar>();

	/** CatsubscriptionsWhereIAmRelation*/
	public void addCatsubscriptionsWhereIAmRelation(nl.reinders.bm.Catsubscription value)
	{
		if (value != null && !iCatsubscriptionsWhereIAmRelation.contains(value))
		{
			iCatsubscriptionsWhereIAmRelation.add(value);
			value.setRelation( (nl.reinders.bm.Relation)this);
		}
	}
	public void removeCatsubscriptionsWhereIAmRelation(nl.reinders.bm.Catsubscription value)
	{
		if (value != null && iCatsubscriptionsWhereIAmRelation.contains(value))
		{
			iCatsubscriptionsWhereIAmRelation.remove(value);
			value.setRelation( (nl.reinders.bm.Relation)null );
		}
	}
	public java.util.List<nl.reinders.bm.Catsubscription> getCatsubscriptionsWhereIAmRelation() { return iCatsubscriptionsWhereIAmRelation; }
	@OneToMany(mappedBy = "iRelation", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Catsubscription.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Catsubscription> iCatsubscriptionsWhereIAmRelation = new java.util.ArrayList<nl.reinders.bm.Catsubscription>();

	/** ContactsWhereIAmRelation*/
	public void addContactsWhereIAmRelation(nl.reinders.bm.Contact value)
	{
		if (value != null && !iContactsWhereIAmRelation.contains(value))
		{
			iContactsWhereIAmRelation.add(value);
			value.setRelation( (nl.reinders.bm.Relation)this);
		}
	}
	public void removeContactsWhereIAmRelation(nl.reinders.bm.Contact value)
	{
		if (value != null && iContactsWhereIAmRelation.contains(value))
		{
			iContactsWhereIAmRelation.remove(value);
			value.setRelation( (nl.reinders.bm.Relation)null );
		}
	}
	public java.util.List<nl.reinders.bm.Contact> getContactsWhereIAmRelation() { return iContactsWhereIAmRelation; }
	@OneToMany(mappedBy = "iRelation", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Contact.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Contact> iContactsWhereIAmRelation = new java.util.ArrayList<nl.reinders.bm.Contact>();

	/** ContractsWhereIAmLicenseeid*/
	public void addContractsWhereIAmLicenseeid(nl.reinders.bm.Contract value)
	{
		if (value != null && !iContractsWhereIAmLicenseeid.contains(value))
		{
			iContractsWhereIAmLicenseeid.add(value);
			value.setLicenseeid( (nl.reinders.bm.Relation)this);
		}
	}
	public void removeContractsWhereIAmLicenseeid(nl.reinders.bm.Contract value)
	{
		if (value != null && iContractsWhereIAmLicenseeid.contains(value))
		{
			iContractsWhereIAmLicenseeid.remove(value);
			value.setLicenseeid( (nl.reinders.bm.Relation)null );
		}
	}
	public java.util.List<nl.reinders.bm.Contract> getContractsWhereIAmLicenseeid() { return iContractsWhereIAmLicenseeid; }
	@OneToMany(mappedBy = "iLicenseeid", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Contract.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Contract> iContractsWhereIAmLicenseeid = new java.util.ArrayList<nl.reinders.bm.Contract>();

	/** ContractsWhereIAmLicensorid*/
	public void addContractsWhereIAmLicensorid(nl.reinders.bm.Contract value)
	{
		if (value != null && !iContractsWhereIAmLicensorid.contains(value))
		{
			iContractsWhereIAmLicensorid.add(value);
			value.setLicensorid( (nl.reinders.bm.Relation)this);
		}
	}
	public void removeContractsWhereIAmLicensorid(nl.reinders.bm.Contract value)
	{
		if (value != null && iContractsWhereIAmLicensorid.contains(value))
		{
			iContractsWhereIAmLicensorid.remove(value);
			value.setLicensorid( (nl.reinders.bm.Relation)null );
		}
	}
	public java.util.List<nl.reinders.bm.Contract> getContractsWhereIAmLicensorid() { return iContractsWhereIAmLicensorid; }
	@OneToMany(mappedBy = "iLicensorid", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Contract.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Contract> iContractsWhereIAmLicensorid = new java.util.ArrayList<nl.reinders.bm.Contract>();

	/** LicensesWhereIAmRelation*/
	public void addLicensesWhereIAmRelation(nl.reinders.bm.License value)
	{
		if (value != null && !iLicensesWhereIAmRelation.contains(value))
		{
			iLicensesWhereIAmRelation.add(value);
			value.setRelation( (nl.reinders.bm.Relation)this);
		}
	}
	public void removeLicensesWhereIAmRelation(nl.reinders.bm.License value)
	{
		if (value != null && iLicensesWhereIAmRelation.contains(value))
		{
			iLicensesWhereIAmRelation.remove(value);
			value.setRelation( (nl.reinders.bm.Relation)null );
		}
	}
	public java.util.List<nl.reinders.bm.License> getLicensesWhereIAmRelation() { return iLicensesWhereIAmRelation; }
	@OneToMany(mappedBy = "iRelation", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.License.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.License> iLicensesWhereIAmRelation = new java.util.ArrayList<nl.reinders.bm.License>();

	/** Rel2RelcatsWhereIAmRelation*/
	public void addRel2RelcatsWhereIAmRelation(nl.reinders.bm.Rel2Relcat value)
	{
		if (value != null && !iRel2RelcatsWhereIAmRelation.contains(value))
		{
			iRel2RelcatsWhereIAmRelation.add(value);
			value.setRelation( (nl.reinders.bm.Relation)this);
		}
	}
	public void removeRel2RelcatsWhereIAmRelation(nl.reinders.bm.Rel2Relcat value)
	{
		if (value != null && iRel2RelcatsWhereIAmRelation.contains(value))
		{
			iRel2RelcatsWhereIAmRelation.remove(value);
			value.setRelation( (nl.reinders.bm.Relation)null );
		}
	}
	public java.util.List<nl.reinders.bm.Rel2Relcat> getRel2RelcatsWhereIAmRelation() { return iRel2RelcatsWhereIAmRelation; }
	@OneToMany(mappedBy = "iRelation", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Rel2Relcat.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Rel2Relcat> iRel2RelcatsWhereIAmRelation = new java.util.ArrayList<nl.reinders.bm.Rel2Relcat>();

	/** RelationsWhereIAmDeliveryRelation*/
	public void addRelationsWhereIAmDeliveryRelation(nl.reinders.bm.Relation value)
	{
		if (value != null && !iRelationsWhereIAmDeliveryRelation.contains(value))
		{
			iRelationsWhereIAmDeliveryRelation.add(value);
			value.setDeliveryRelation( (nl.reinders.bm.Relation)this);
		}
	}
	public void removeRelationsWhereIAmDeliveryRelation(nl.reinders.bm.Relation value)
	{
		if (value != null && iRelationsWhereIAmDeliveryRelation.contains(value))
		{
			iRelationsWhereIAmDeliveryRelation.remove(value);
			value.setDeliveryRelation( (nl.reinders.bm.Relation)null );
		}
	}
	public java.util.List<nl.reinders.bm.Relation> getRelationsWhereIAmDeliveryRelation() { return iRelationsWhereIAmDeliveryRelation; }
	@OneToMany(mappedBy = "iDeliveryRelation", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Relation.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Relation> iRelationsWhereIAmDeliveryRelation = new java.util.ArrayList<nl.reinders.bm.Relation>();

	/** RelationstandsWhereIAmRelation*/
	public void addRelationstandsWhereIAmRelation(nl.reinders.bm.Relationstand value)
	{
		if (value != null && !iRelationstandsWhereIAmRelation.contains(value))
		{
			iRelationstandsWhereIAmRelation.add(value);
			value.setRelation( (nl.reinders.bm.Relation)this);
		}
	}
	public void removeRelationstandsWhereIAmRelation(nl.reinders.bm.Relationstand value)
	{
		if (value != null && iRelationstandsWhereIAmRelation.contains(value))
		{
			iRelationstandsWhereIAmRelation.remove(value);
			value.setRelation( (nl.reinders.bm.Relation)null );
		}
	}
	public java.util.List<nl.reinders.bm.Relationstand> getRelationstandsWhereIAmRelation() { return iRelationstandsWhereIAmRelation; }
	@OneToMany(mappedBy = "iRelation", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Relationstand.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Relationstand> iRelationstandsWhereIAmRelation = new java.util.ArrayList<nl.reinders.bm.Relationstand>();

	/** RelationtelsWhereIAmRelation*/
	public void addRelationtelsWhereIAmRelation(nl.reinders.bm.Relationtel value)
	{
		if (value != null && !iRelationtelsWhereIAmRelation.contains(value))
		{
			iRelationtelsWhereIAmRelation.add(value);
			value.setRelation( (nl.reinders.bm.Relation)this);
		}
	}
	public void removeRelationtelsWhereIAmRelation(nl.reinders.bm.Relationtel value)
	{
		if (value != null && iRelationtelsWhereIAmRelation.contains(value))
		{
			iRelationtelsWhereIAmRelation.remove(value);
			value.setRelation( (nl.reinders.bm.Relation)null );
		}
	}
	public java.util.List<nl.reinders.bm.Relationtel> getRelationtelsWhereIAmRelation() { return iRelationtelsWhereIAmRelation; }
	@OneToMany(mappedBy = "iRelation", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Relationtel.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Relationtel> iRelationtelsWhereIAmRelation = new java.util.ArrayList<nl.reinders.bm.Relationtel>();

	/** RelstandsalesWhereIAmRelation*/
	public void addRelstandsalesWhereIAmRelation(nl.reinders.bm.Relstandsale value)
	{
		if (value != null && !iRelstandsalesWhereIAmRelation.contains(value))
		{
			iRelstandsalesWhereIAmRelation.add(value);
			value.setRelation( (nl.reinders.bm.Relation)this);
		}
	}
	public void removeRelstandsalesWhereIAmRelation(nl.reinders.bm.Relstandsale value)
	{
		if (value != null && iRelstandsalesWhereIAmRelation.contains(value))
		{
			iRelstandsalesWhereIAmRelation.remove(value);
			value.setRelation( (nl.reinders.bm.Relation)null );
		}
	}
	public java.util.List<nl.reinders.bm.Relstandsale> getRelstandsalesWhereIAmRelation() { return iRelstandsalesWhereIAmRelation; }
	@OneToMany(mappedBy = "iRelation", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Relstandsale.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Relstandsale> iRelstandsalesWhereIAmRelation = new java.util.ArrayList<nl.reinders.bm.Relstandsale>();

	/** RelstandstocksWhereIAmRelation*/
	public void addRelstandstocksWhereIAmRelation(nl.reinders.bm.Relstandstock value)
	{
		if (value != null && !iRelstandstocksWhereIAmRelation.contains(value))
		{
			iRelstandstocksWhereIAmRelation.add(value);
			value.setRelation( (nl.reinders.bm.Relation)this);
		}
	}
	public void removeRelstandstocksWhereIAmRelation(nl.reinders.bm.Relstandstock value)
	{
		if (value != null && iRelstandstocksWhereIAmRelation.contains(value))
		{
			iRelstandstocksWhereIAmRelation.remove(value);
			value.setRelation( (nl.reinders.bm.Relation)null );
		}
	}
	public java.util.List<nl.reinders.bm.Relstandstock> getRelstandstocksWhereIAmRelation() { return iRelstandstocksWhereIAmRelation; }
	@OneToMany(mappedBy = "iRelation", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Relstandstock.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Relstandstock> iRelstandstocksWhereIAmRelation = new java.util.ArrayList<nl.reinders.bm.Relstandstock>();

	/** SellordersWhereIAmRelation*/
	public void addSellordersWhereIAmRelation(nl.reinders.bm.Sellorder value)
	{
		if (value != null && !iSellordersWhereIAmRelation.contains(value))
		{
			iSellordersWhereIAmRelation.add(value);
			value.setRelation( (nl.reinders.bm.Relation)this);
		}
	}
	public void removeSellordersWhereIAmRelation(nl.reinders.bm.Sellorder value)
	{
		if (value != null && iSellordersWhereIAmRelation.contains(value))
		{
			iSellordersWhereIAmRelation.remove(value);
			value.setRelation( (nl.reinders.bm.Relation)null );
		}
	}
	public java.util.List<nl.reinders.bm.Sellorder> getSellordersWhereIAmRelation() { return iSellordersWhereIAmRelation; }
	@OneToMany(mappedBy = "iRelation", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Sellorder.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Sellorder> iSellordersWhereIAmRelation = new java.util.ArrayList<nl.reinders.bm.Sellorder>();


	// ===============================================================================================
	// RELATIONS ManyToOne

	/** DeliveryAddress */
	public nl.reinders.bm.Address getDeliveryAddress() { return iDeliveryAddress; }
	public void setDeliveryAddress(nl.reinders.bm.Address value)
	{
		if (value == iDeliveryAddress) return; // optimalisation and prevent looping
		try
		{
			nl.reinders.bm.Address lValue = iDeliveryAddress;
			fireVetoableChange(DELIVERYADDRESS_PROPERTY_ID, lValue, value);
			if (lValue != null) lValue.removeRelationsWhereIAmDeliveryAddress( (nl.reinders.bm.Relation)this );
			iDeliveryAddress = value;
			if (value != null) value.addRelationsWhereIAmDeliveryAddress( (nl.reinders.bm.Relation)this );
			firePropertyChange(DELIVERYADDRESS_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@ManyToOne(fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Address.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} ) @JoinColumn(name="delivery_addressnr") 
	private nl.reinders.bm.Address iDeliveryAddress;
	final static public String DELIVERYADDRESS_PROPERTY_ID = "deliveryAddress";
	final static public Class DELIVERYADDRESS_PROPERTY_CLASS = nl.reinders.bm.Address.class;
	final static public String DELIVERYADDRESS_NAME = "DeliveryAddress"; // with this ID you can access the internationalization
	// to make IN queryies possible
	@Column(name="delivery_addressnr", insertable=false, updatable=false)
	private java.math.BigDecimal iDeliveryAddressnr = null;

	/** Btw */
	public nl.reinders.bm.Btwcategory getBtw() { return iBtw; }
	public void setBtw(nl.reinders.bm.Btwcategory value)
	{
		if (value == iBtw) return; // optimalisation and prevent looping
		try
		{
			nl.reinders.bm.Btwcategory lValue = iBtw;
			fireVetoableChange(BTW_PROPERTY_ID, lValue, value);
			if (lValue != null) lValue.removeRelationsWhereIAmBtw( (nl.reinders.bm.Relation)this );
			iBtw = value;
			if (value != null) value.addRelationsWhereIAmBtw( (nl.reinders.bm.Relation)this );
			firePropertyChange(BTW_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@ManyToOne(fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Btwcategory.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} ) @JoinColumn(name="btwnr") 
	private nl.reinders.bm.Btwcategory iBtw;
	final static public String BTW_PROPERTY_ID = "btw";
	final static public Class BTW_PROPERTY_CLASS = nl.reinders.bm.Btwcategory.class;
	final static public String BTW_NAME = "Btw"; // with this ID you can access the internationalization
	// to make IN queryies possible
	@Column(name="btwnr", insertable=false, updatable=false)
	private java.math.BigDecimal iBtwnr = null;

	/** Currency */
	public nl.reinders.bm.Currency getCurrency() { return iCurrency; }
	public void setCurrency(nl.reinders.bm.Currency value)
	{
		if (value == iCurrency) return; // optimalisation and prevent looping
		try
		{
			nl.reinders.bm.Currency lValue = iCurrency;
			fireVetoableChange(CURRENCY_PROPERTY_ID, lValue, value);
			if (lValue != null) lValue.removeRelationsWhereIAmCurrency( (nl.reinders.bm.Relation)this );
			iCurrency = value;
			if (value != null) value.addRelationsWhereIAmCurrency( (nl.reinders.bm.Relation)this );
			firePropertyChange(CURRENCY_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@ManyToOne(fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Currency.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} ) @JoinColumn(name="currencynr") 
	private nl.reinders.bm.Currency iCurrency;
	final static public String CURRENCY_PROPERTY_ID = "currency";
	final static public Class CURRENCY_PROPERTY_CLASS = nl.reinders.bm.Currency.class;
	final static public String CURRENCY_NAME = "Currency"; // with this ID you can access the internationalization
	// to make IN queryies possible
	@Column(name="currencynr", insertable=false, updatable=false)
	private java.math.BigDecimal iCurrencynr = null;

	/** DeliveryRelation */
	public nl.reinders.bm.Relation getDeliveryRelation() { return iDeliveryRelation; }
	public void setDeliveryRelation(nl.reinders.bm.Relation value)
	{
		if (value == iDeliveryRelation) return; // optimalisation and prevent looping
		try
		{
			nl.reinders.bm.Relation lValue = iDeliveryRelation;
			fireVetoableChange(DELIVERYRELATION_PROPERTY_ID, lValue, value);
			if (lValue != null) lValue.removeRelationsWhereIAmDeliveryRelation( (nl.reinders.bm.Relation)this );
			iDeliveryRelation = value;
			if (value != null) value.addRelationsWhereIAmDeliveryRelation( (nl.reinders.bm.Relation)this );
			firePropertyChange(DELIVERYRELATION_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@ManyToOne(fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Relation.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} ) @JoinColumn(name="delivery_relationnr") 
	private nl.reinders.bm.Relation iDeliveryRelation;
	final static public String DELIVERYRELATION_PROPERTY_ID = "deliveryRelation";
	final static public Class DELIVERYRELATION_PROPERTY_CLASS = nl.reinders.bm.Relation.class;
	final static public String DELIVERYRELATION_NAME = "DeliveryRelation"; // with this ID you can access the internationalization
	// to make IN queryies possible
	@Column(name="delivery_relationnr", insertable=false, updatable=false)
	private java.math.BigDecimal iDeliveryRelationnr = null;

	/** Relationgroup */
	public nl.reinders.bm.Relationgroup getRelationgroup() { return iRelationgroup; }
	public void setRelationgroup(nl.reinders.bm.Relationgroup value)
	{
		if (value == iRelationgroup) return; // optimalisation and prevent looping
		try
		{
			nl.reinders.bm.Relationgroup lValue = iRelationgroup;
			fireVetoableChange(RELATIONGROUP_PROPERTY_ID, lValue, value);
			if (lValue != null) lValue.removeRelationsWhereIAmRelationgroup( (nl.reinders.bm.Relation)this );
			iRelationgroup = value;
			if (value != null) value.addRelationsWhereIAmRelationgroup( (nl.reinders.bm.Relation)this );
			firePropertyChange(RELATIONGROUP_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@ManyToOne(fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Relationgroup.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} ) @JoinColumn(name="relationgroupnr") 
	private nl.reinders.bm.Relationgroup iRelationgroup;
	final static public String RELATIONGROUP_PROPERTY_ID = "relationgroup";
	final static public Class RELATIONGROUP_PROPERTY_CLASS = nl.reinders.bm.Relationgroup.class;
	final static public String RELATIONGROUP_NAME = "Relationgroup"; // with this ID you can access the internationalization
	// to make IN queryies possible
	@Column(name="relationgroupnr", insertable=false, updatable=false)
	private java.math.BigDecimal iRelationgroupnr = null;



	// ===============================================================================================
	// PROPERTIES

	/** Retour */
	public String getRetour() { return iRetour; }
	public void setRetour(String value)
	{
		try
		{
			String lValue = iRetour;
			if (log4j.isDebugEnabled()) log4j.debug("setRetour: " + lValue + " -> " + value);
			fireVetoableChange(RETOUR_PROPERTY_ID, lValue, value);
			iRetour = value;
			firePropertyChange(RETOUR_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="retour")
	private String iRetour = null;
	final static public String RETOUR_PROPERTY_ID = "retour";
	final static public Class RETOUR_PROPERTY_CLASS = String.class;
	final static public String RETOUR_NAME = "Retour"; // with this ID you can access the internationalization

	/** Relationnr */
	public Integer getRelationnr() { return iRelationnr; }
	public void setRelationnr(Integer value)
	{
		try
		{
			Integer lValue = iRelationnr;
			if (log4j.isDebugEnabled()) log4j.debug("setRelationnr: " + lValue + " -> " + value);
			fireVetoableChange(RELATIONNR_PROPERTY_ID, lValue, value);
			iRelationnr = value;
			firePropertyChange(RELATIONNR_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Id @GeneratedValue(generator="relation.relationnr", strategy=GenerationType.TABLE) @TableGenerator( name="relation.relationnr", pkColumnValue="relationnr", table="sequence", pkColumnName="seq_name", valueColumnName="seq_count", initialValue=1, allocationSize=1) @Column(name="relationnr")
	private Integer iRelationnr = null;
	final static public String RELATIONNR_PROPERTY_ID = "relationnr";
	final static public Class RELATIONNR_PROPERTY_CLASS = Integer.class;
	final static public String RELATIONNR_NAME = "Relationnr"; // with this ID you can access the internationalization

	/** Name */
	public String getName() { return iName; }
	public void setName(String value)
	{
		try
		{
			String lValue = iName;
			if (log4j.isDebugEnabled()) log4j.debug("setName: " + lValue + " -> " + value);
			fireVetoableChange(NAME_PROPERTY_ID, lValue, value);
			iName = value;
			firePropertyChange(NAME_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="name")
	private String iName = null;
	final static public String NAME_PROPERTY_ID = "name";
	final static public Class NAME_PROPERTY_CLASS = String.class;
	final static public String NAME_NAME = "Name"; // with this ID you can access the internationalization

	/** Haspriceagreement */
	public Integer getHaspriceagreement() { return iHaspriceagreement; }
	public void setHaspriceagreement(Integer value)
	{
		try
		{
			Integer lValue = iHaspriceagreement;
			if (log4j.isDebugEnabled()) log4j.debug("setHaspriceagreement: " + lValue + " -> " + value);
			fireVetoableChange(HASPRICEAGREEMENT_PROPERTY_ID, lValue, value);
			iHaspriceagreement = value;
			firePropertyChange(HASPRICEAGREEMENT_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="haspriceagreement")
	private Integer iHaspriceagreement = null;
	final static public String HASPRICEAGREEMENT_PROPERTY_ID = "haspriceagreement";
	final static public Class HASPRICEAGREEMENT_PROPERTY_CLASS = Integer.class;
	final static public String HASPRICEAGREEMENT_NAME = "Haspriceagreement"; // with this ID you can access the internationalization

	/** AllowBuyorder */
	public Integer getAllowBuyorder() { return iAllowBuyorder; }
	public void setAllowBuyorder(Integer value)
	{
		try
		{
			Integer lValue = iAllowBuyorder;
			if (log4j.isDebugEnabled()) log4j.debug("setAllowBuyorder: " + lValue + " -> " + value);
			fireVetoableChange(ALLOWBUYORDER_PROPERTY_ID, lValue, value);
			iAllowBuyorder = value;
			firePropertyChange(ALLOWBUYORDER_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="allow_buyorder")
	private Integer iAllowBuyorder = null;
	final static public String ALLOWBUYORDER_PROPERTY_ID = "allowBuyorder";
	final static public Class ALLOWBUYORDER_PROPERTY_CLASS = Integer.class;
	final static public String ALLOWBUYORDER_NAME = "AllowBuyorder"; // with this ID you can access the internationalization

	/** AllowSellorder */
	public Integer getAllowSellorder() { return iAllowSellorder; }
	public void setAllowSellorder(Integer value)
	{
		try
		{
			Integer lValue = iAllowSellorder;
			if (log4j.isDebugEnabled()) log4j.debug("setAllowSellorder: " + lValue + " -> " + value);
			fireVetoableChange(ALLOWSELLORDER_PROPERTY_ID, lValue, value);
			iAllowSellorder = value;
			firePropertyChange(ALLOWSELLORDER_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="allow_sellorder")
	private Integer iAllowSellorder = null;
	final static public String ALLOWSELLORDER_PROPERTY_ID = "allowSellorder";
	final static public Class ALLOWSELLORDER_PROPERTY_CLASS = Integer.class;
	final static public String ALLOWSELLORDER_NAME = "AllowSellorder"; // with this ID you can access the internationalization

	/** AllowBackorders */
	public Integer getAllowBackorders() { return iAllowBackorders; }
	public void setAllowBackorders(Integer value)
	{
		try
		{
			Integer lValue = iAllowBackorders;
			if (log4j.isDebugEnabled()) log4j.debug("setAllowBackorders: " + lValue + " -> " + value);
			fireVetoableChange(ALLOWBACKORDERS_PROPERTY_ID, lValue, value);
			iAllowBackorders = value;
			firePropertyChange(ALLOWBACKORDERS_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="allow_backorders")
	private Integer iAllowBackorders = null;
	final static public String ALLOWBACKORDERS_PROPERTY_ID = "allowBackorders";
	final static public Class ALLOWBACKORDERS_PROPERTY_CLASS = Integer.class;
	final static public String ALLOWBACKORDERS_NAME = "AllowBackorders"; // with this ID you can access the internationalization

	/** Externalnr */
	public String getExternalnr() { return iExternalnr; }
	public void setExternalnr(String value)
	{
		try
		{
			String lValue = iExternalnr;
			if (log4j.isDebugEnabled()) log4j.debug("setExternalnr: " + lValue + " -> " + value);
			fireVetoableChange(EXTERNALNR_PROPERTY_ID, lValue, value);
			iExternalnr = value;
			firePropertyChange(EXTERNALNR_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="externalnr")
	private String iExternalnr = null;
	final static public String EXTERNALNR_PROPERTY_ID = "externalnr";
	final static public Class EXTERNALNR_PROPERTY_CLASS = String.class;
	final static public String EXTERNALNR_NAME = "Externalnr"; // with this ID you can access the internationalization

	/** Ritnr */
	public String getRitnr() { return iRitnr; }
	public void setRitnr(String value)
	{
		try
		{
			String lValue = iRitnr;
			if (log4j.isDebugEnabled()) log4j.debug("setRitnr: " + lValue + " -> " + value);
			fireVetoableChange(RITNR_PROPERTY_ID, lValue, value);
			iRitnr = value;
			firePropertyChange(RITNR_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="ritnr")
	private String iRitnr = null;
	final static public String RITNR_PROPERTY_ID = "ritnr";
	final static public Class RITNR_PROPERTY_CLASS = String.class;
	final static public String RITNR_NAME = "Ritnr"; // with this ID you can access the internationalization

	/** Info */
	public String getInfo() { return iInfo; }
	public void setInfo(String value)
	{
		try
		{
			String lValue = iInfo;
			if (log4j.isDebugEnabled()) log4j.debug("setInfo: " + lValue + " -> " + value);
			fireVetoableChange(INFO_PROPERTY_ID, lValue, value);
			iInfo = value;
			firePropertyChange(INFO_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="info")
	private String iInfo = null;
	final static public String INFO_PROPERTY_ID = "info";
	final static public Class INFO_PROPERTY_CLASS = String.class;
	final static public String INFO_NAME = "Info"; // with this ID you can access the internationalization

	/** Internalnr */
	public Integer getInternalnr() { return iInternalnr; }
	public void setInternalnr(Integer value)
	{
		try
		{
			Integer lValue = iInternalnr;
			if (log4j.isDebugEnabled()) log4j.debug("setInternalnr: " + lValue + " -> " + value);
			fireVetoableChange(INTERNALNR_PROPERTY_ID, lValue, value);
			iInternalnr = value;
			firePropertyChange(INTERNALNR_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="internalnr")
	private Integer iInternalnr = null;
	final static public String INTERNALNR_PROPERTY_ID = "internalnr";
	final static public Class INTERNALNR_PROPERTY_CLASS = Integer.class;
	final static public String INTERNALNR_NAME = "Internalnr"; // with this ID you can access the internationalization

	/** Rabatt */
	public java.math.BigDecimal getRabatt() { return iRabatt; }
	public void setRabatt(java.math.BigDecimal value)
	{
		try
		{
			java.math.BigDecimal lValue = iRabatt;
			if (log4j.isDebugEnabled()) log4j.debug("setRabatt: " + lValue + " -> " + value);
			fireVetoableChange(RABATT_PROPERTY_ID, lValue, value);
			iRabatt = value;
			firePropertyChange(RABATT_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="rabatt")
	private java.math.BigDecimal iRabatt = null;
	final static public String RABATT_PROPERTY_ID = "rabatt";
	final static public Class RABATT_PROPERTY_CLASS = java.math.BigDecimal.class;
	final static public String RABATT_NAME = "Rabatt"; // with this ID you can access the internationalization

	/** Bez */
	public java.math.BigDecimal getBez() { return iBez; }
	public void setBez(java.math.BigDecimal value)
	{
		try
		{
			java.math.BigDecimal lValue = iBez;
			if (log4j.isDebugEnabled()) log4j.debug("setBez: " + lValue + " -> " + value);
			fireVetoableChange(BEZ_PROPERTY_ID, lValue, value);
			iBez = value;
			firePropertyChange(BEZ_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="bez")
	private java.math.BigDecimal iBez = null;
	final static public String BEZ_PROPERTY_ID = "bez";
	final static public Class BEZ_PROPERTY_CLASS = java.math.BigDecimal.class;
	final static public String BEZ_NAME = "Bez"; // with this ID you can access the internationalization

	/** Skonto */
	public java.math.BigDecimal getSkonto() { return iSkonto; }
	public void setSkonto(java.math.BigDecimal value)
	{
		try
		{
			java.math.BigDecimal lValue = iSkonto;
			if (log4j.isDebugEnabled()) log4j.debug("setSkonto: " + lValue + " -> " + value);
			fireVetoableChange(SKONTO_PROPERTY_ID, lValue, value);
			iSkonto = value;
			firePropertyChange(SKONTO_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="skonto")
	private java.math.BigDecimal iSkonto = null;
	final static public String SKONTO_PROPERTY_ID = "skonto";
	final static public Class SKONTO_PROPERTY_CLASS = java.math.BigDecimal.class;
	final static public String SKONTO_NAME = "Skonto"; // with this ID you can access the internationalization

	/** Lazylock */
	public Integer getLazylock() { return iLazylock; }
	public void setLazylock(Integer value)
	{
		try
		{
			Integer lValue = iLazylock;
			if (log4j.isDebugEnabled()) log4j.debug("setLazylock: " + lValue + " -> " + value);
			fireVetoableChange(LAZYLOCK_PROPERTY_ID, lValue, value);
			iLazylock = value;
			firePropertyChange(LAZYLOCK_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Version @Column(name="lazylock")
	private Integer iLazylock = 0;
	final static public String LAZYLOCK_PROPERTY_ID = "lazylock";
	final static public Class LAZYLOCK_PROPERTY_CLASS = Integer.class;
	final static public String LAZYLOCK_NAME = "Lazylock"; // with this ID you can access the internationalization

	/** Grootboeknr */
	public Integer getGrootboeknr() { return iGrootboeknr; }
	public void setGrootboeknr(Integer value)
	{
		try
		{
			Integer lValue = iGrootboeknr;
			if (log4j.isDebugEnabled()) log4j.debug("setGrootboeknr: " + lValue + " -> " + value);
			fireVetoableChange(GROOTBOEKNR_PROPERTY_ID, lValue, value);
			iGrootboeknr = value;
			firePropertyChange(GROOTBOEKNR_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="grootboeknr")
	private Integer iGrootboeknr = null;
	final static public String GROOTBOEKNR_PROPERTY_ID = "grootboeknr";
	final static public Class GROOTBOEKNR_PROPERTY_CLASS = Integer.class;
	final static public String GROOTBOEKNR_NAME = "Grootboeknr"; // with this ID you can access the internationalization

	/** Relationnr2 */
	public Integer getRelationnr2() { return iRelationnr2; }
	public void setRelationnr2(Integer value)
	{
		try
		{
			Integer lValue = iRelationnr2;
			if (log4j.isDebugEnabled()) log4j.debug("setRelationnr2: " + lValue + " -> " + value);
			fireVetoableChange(RELATIONNR2_PROPERTY_ID, lValue, value);
			iRelationnr2 = value;
			firePropertyChange(RELATIONNR2_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="relationnr2")
	private Integer iRelationnr2 = null;
	final static public String RELATIONNR2_PROPERTY_ID = "relationnr2";
	final static public Class RELATIONNR2_PROPERTY_CLASS = Integer.class;
	final static public String RELATIONNR2_NAME = "Relationnr2"; // with this ID you can access the internationalization

	/** Btwnummer */
	public String getBtwnummer() { return iBtwnummer; }
	public void setBtwnummer(String value)
	{
		try
		{
			String lValue = iBtwnummer;
			if (log4j.isDebugEnabled()) log4j.debug("setBtwnummer: " + lValue + " -> " + value);
			fireVetoableChange(BTWNUMMER_PROPERTY_ID, lValue, value);
			iBtwnummer = value;
			firePropertyChange(BTWNUMMER_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="btwnummer")
	private String iBtwnummer = null;
	final static public String BTWNUMMER_PROPERTY_ID = "btwnummer";
	final static public Class BTWNUMMER_PROPERTY_CLASS = String.class;
	final static public String BTWNUMMER_NAME = "Btwnummer"; // with this ID you can access the internationalization

	/** Officeid */
	public String getOfficeid() { return iOfficeid; }
	public void setOfficeid(String value)
	{
		try
		{
			String lValue = iOfficeid;
			if (log4j.isDebugEnabled()) log4j.debug("setOfficeid: " + lValue + " -> " + value);
			fireVetoableChange(OFFICEID_PROPERTY_ID, lValue, value);
			iOfficeid = value;
			firePropertyChange(OFFICEID_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="officeid")
	private String iOfficeid = null;
	final static public String OFFICEID_PROPERTY_ID = "officeid";
	final static public Class OFFICEID_PROPERTY_CLASS = String.class;
	final static public String OFFICEID_NAME = "Officeid"; // with this ID you can access the internationalization

	/** Incassobanknr */
	public java.math.BigDecimal getIncassobanknr() { return iIncassobanknr; }
	public void setIncassobanknr(java.math.BigDecimal value)
	{
		try
		{
			java.math.BigDecimal lValue = iIncassobanknr;
			if (log4j.isDebugEnabled()) log4j.debug("setIncassobanknr: " + lValue + " -> " + value);
			fireVetoableChange(INCASSOBANKNR_PROPERTY_ID, lValue, value);
			iIncassobanknr = value;
			firePropertyChange(INCASSOBANKNR_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="incassobanknr")
	private java.math.BigDecimal iIncassobanknr = null;
	final static public String INCASSOBANKNR_PROPERTY_ID = "incassobanknr";
	final static public Class INCASSOBANKNR_PROPERTY_CLASS = java.math.BigDecimal.class;
	final static public String INCASSOBANKNR_NAME = "Incassobanknr"; // with this ID you can access the internationalization

	/** Incassoreknr */
	public java.math.BigDecimal getIncassoreknr() { return iIncassoreknr; }
	public void setIncassoreknr(java.math.BigDecimal value)
	{
		try
		{
			java.math.BigDecimal lValue = iIncassoreknr;
			if (log4j.isDebugEnabled()) log4j.debug("setIncassoreknr: " + lValue + " -> " + value);
			fireVetoableChange(INCASSOREKNR_PROPERTY_ID, lValue, value);
			iIncassoreknr = value;
			firePropertyChange(INCASSOREKNR_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="incassoreknr")
	private java.math.BigDecimal iIncassoreknr = null;
	final static public String INCASSOREKNR_PROPERTY_ID = "incassoreknr";
	final static public Class INCASSOREKNR_PROPERTY_CLASS = java.math.BigDecimal.class;
	final static public String INCASSOREKNR_NAME = "Incassoreknr"; // with this ID you can access the internationalization

	/** Incassodagen */
	public Integer getIncassodagen() { return iIncassodagen; }
	public void setIncassodagen(Integer value)
	{
		try
		{
			Integer lValue = iIncassodagen;
			if (log4j.isDebugEnabled()) log4j.debug("setIncassodagen: " + lValue + " -> " + value);
			fireVetoableChange(INCASSODAGEN_PROPERTY_ID, lValue, value);
			iIncassodagen = value;
			firePropertyChange(INCASSODAGEN_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="incassodagen")
	private Integer iIncassodagen = null;
	final static public String INCASSODAGEN_PROPERTY_ID = "incassodagen";
	final static public Class INCASSODAGEN_PROPERTY_CLASS = Integer.class;
	final static public String INCASSODAGEN_NAME = "Incassodagen"; // with this ID you can access the internationalization

	/** Shortname */
	public String getShortname() { return iShortname; }
	public void setShortname(String value)
	{
		try
		{
			String lValue = iShortname;
			if (log4j.isDebugEnabled()) log4j.debug("setShortname: " + lValue + " -> " + value);
			fireVetoableChange(SHORTNAME_PROPERTY_ID, lValue, value);
			iShortname = value;
			firePropertyChange(SHORTNAME_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="shortname")
	private String iShortname = null;
	final static public String SHORTNAME_PROPERTY_ID = "shortname";
	final static public Class SHORTNAME_PROPERTY_CLASS = String.class;
	final static public String SHORTNAME_NAME = "Shortname"; // with this ID you can access the internationalization

	/** Officegroupid */
	public String getOfficegroupid() { return iOfficegroupid; }
	public void setOfficegroupid(String value)
	{
		try
		{
			String lValue = iOfficegroupid;
			if (log4j.isDebugEnabled()) log4j.debug("setOfficegroupid: " + lValue + " -> " + value);
			fireVetoableChange(OFFICEGROUPID_PROPERTY_ID, lValue, value);
			iOfficegroupid = value;
			firePropertyChange(OFFICEGROUPID_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="officegroupid")
	private String iOfficegroupid = null;
	final static public String OFFICEGROUPID_PROPERTY_ID = "officegroupid";
	final static public Class OFFICEGROUPID_PROPERTY_CLASS = String.class;
	final static public String OFFICEGROUPID_NAME = "Officegroupid"; // with this ID you can access the internationalization

	/** Skontodagen */
	public Integer getSkontodagen() { return iSkontodagen; }
	public void setSkontodagen(Integer value)
	{
		try
		{
			Integer lValue = iSkontodagen;
			if (log4j.isDebugEnabled()) log4j.debug("setSkontodagen: " + lValue + " -> " + value);
			fireVetoableChange(SKONTODAGEN_PROPERTY_ID, lValue, value);
			iSkontodagen = value;
			firePropertyChange(SKONTODAGEN_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="skontodagen")
	private Integer iSkontodagen = null;
	final static public String SKONTODAGEN_PROPERTY_ID = "skontodagen";
	final static public Class SKONTODAGEN_PROPERTY_CLASS = Integer.class;
	final static public String SKONTODAGEN_NAME = "Skontodagen"; // with this ID you can access the internationalization

	/** Tobepaidwithin */
	public Integer getTobepaidwithin() { return iTobepaidwithin; }
	public void setTobepaidwithin(Integer value)
	{
		try
		{
			Integer lValue = iTobepaidwithin;
			if (log4j.isDebugEnabled()) log4j.debug("setTobepaidwithin: " + lValue + " -> " + value);
			fireVetoableChange(TOBEPAIDWITHIN_PROPERTY_ID, lValue, value);
			iTobepaidwithin = value;
			firePropertyChange(TOBEPAIDWITHIN_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="tobepaidwithin")
	private Integer iTobepaidwithin = null;
	final static public String TOBEPAIDWITHIN_PROPERTY_ID = "tobepaidwithin";
	final static public Class TOBEPAIDWITHIN_PROPERTY_CLASS = Integer.class;
	final static public String TOBEPAIDWITHIN_NAME = "Tobepaidwithin"; // with this ID you can access the internationalization

	/** Banknaam */
	public String getBanknaam() { return iBanknaam; }
	public void setBanknaam(String value)
	{
		try
		{
			String lValue = iBanknaam;
			if (log4j.isDebugEnabled()) log4j.debug("setBanknaam: " + lValue + " -> " + value);
			fireVetoableChange(BANKNAAM_PROPERTY_ID, lValue, value);
			iBanknaam = value;
			firePropertyChange(BANKNAAM_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="banknaam")
	private String iBanknaam = null;
	final static public String BANKNAAM_PROPERTY_ID = "banknaam";
	final static public Class BANKNAAM_PROPERTY_CLASS = String.class;
	final static public String BANKNAAM_NAME = "Banknaam"; // with this ID you can access the internationalization

	/** Dwhmodified */
	public java.util.Calendar getDwhmodified() { return iDwhmodified; }
	public void setDwhmodified(java.util.Calendar value)
	{
		try
		{
			java.util.Calendar lValue = iDwhmodified;
			if (log4j.isDebugEnabled()) log4j.debug("setDwhmodified: " + lValue + " -> " + value);
			fireVetoableChange(DWHMODIFIED_PROPERTY_ID, lValue, value);
			iDwhmodified = value;
			firePropertyChange(DWHMODIFIED_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Temporal(TemporalType.TIMESTAMP) @Column(name="dwhmodified")
	private java.util.Calendar iDwhmodified = new java.util.GregorianCalendar();
	final static public String DWHMODIFIED_PROPERTY_ID = "dwhmodified";
	final static public Class DWHMODIFIED_PROPERTY_CLASS = java.util.Calendar.class;
	final static public String DWHMODIFIED_NAME = "Dwhmodified"; // with this ID you can access the internationalization

	/** Dwhby */
	public Integer getDwhby() { return iDwhby; }
	public void setDwhby(Integer value)
	{
		try
		{
			Integer lValue = iDwhby;
			if (log4j.isDebugEnabled()) log4j.debug("setDwhby: " + lValue + " -> " + value);
			fireVetoableChange(DWHBY_PROPERTY_ID, lValue, value);
			iDwhby = value;
			firePropertyChange(DWHBY_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="dwhby")
	private Integer iDwhby = null;
	final static public String DWHBY_PROPERTY_ID = "dwhby";
	final static public Class DWHBY_PROPERTY_CLASS = Integer.class;
	final static public String DWHBY_NAME = "Dwhby"; // with this ID you can access the internationalization

	/** Belastingnr */
	public String getBelastingnr() { return iBelastingnr; }
	public void setBelastingnr(String value)
	{
		try
		{
			String lValue = iBelastingnr;
			if (log4j.isDebugEnabled()) log4j.debug("setBelastingnr: " + lValue + " -> " + value);
			fireVetoableChange(BELASTINGNR_PROPERTY_ID, lValue, value);
			iBelastingnr = value;
			firePropertyChange(BELASTINGNR_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="belastingnr")
	private String iBelastingnr = null;
	final static public String BELASTINGNR_PROPERTY_ID = "belastingnr";
	final static public Class BELASTINGNR_PROPERTY_CLASS = String.class;
	final static public String BELASTINGNR_NAME = "Belastingnr"; // with this ID you can access the internationalization

	/** Istransport */
	public Integer getIstransport() { return iIstransport; }
	public void setIstransport(Integer value)
	{
		try
		{
			Integer lValue = iIstransport;
			if (log4j.isDebugEnabled()) log4j.debug("setIstransport: " + lValue + " -> " + value);
			fireVetoableChange(ISTRANSPORT_PROPERTY_ID, lValue, value);
			iIstransport = value;
			firePropertyChange(ISTRANSPORT_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="istransport")
	private Integer iIstransport = 0;
	final static public String ISTRANSPORT_PROPERTY_ID = "istransport";
	final static public Class ISTRANSPORT_PROPERTY_CLASS = Integer.class;
	final static public String ISTRANSPORT_NAME = "Istransport"; // with this ID you can access the internationalization

	/** AgreementInfo */
	public String getAgreementInfo() { return iAgreementInfo; }
	public void setAgreementInfo(String value)
	{
		try
		{
			String lValue = iAgreementInfo;
			if (log4j.isDebugEnabled()) log4j.debug("setAgreementInfo: " + lValue + " -> " + value);
			fireVetoableChange(AGREEMENTINFO_PROPERTY_ID, lValue, value);
			iAgreementInfo = value;
			firePropertyChange(AGREEMENTINFO_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="agreement_info")
	private String iAgreementInfo = null;
	final static public String AGREEMENTINFO_PROPERTY_ID = "agreementInfo";
	final static public Class AGREEMENTINFO_PROPERTY_CLASS = String.class;
	final static public String AGREEMENTINFO_NAME = "AgreementInfo"; // with this ID you can access the internationalization

	/** PaymentAgreement */
	public String getPaymentAgreement() { return iPaymentAgreement; }
	public void setPaymentAgreement(String value)
	{
		try
		{
			String lValue = iPaymentAgreement;
			if (log4j.isDebugEnabled()) log4j.debug("setPaymentAgreement: " + lValue + " -> " + value);
			fireVetoableChange(PAYMENTAGREEMENT_PROPERTY_ID, lValue, value);
			iPaymentAgreement = value;
			firePropertyChange(PAYMENTAGREEMENT_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="payment_agreement")
	private String iPaymentAgreement = null;
	final static public String PAYMENTAGREEMENT_PROPERTY_ID = "paymentAgreement";
	final static public Class PAYMENTAGREEMENT_PROPERTY_CLASS = String.class;
	final static public String PAYMENTAGREEMENT_NAME = "PaymentAgreement"; // with this ID you can access the internationalization

	/** ReindersLieferantenkode */
	public String getReindersLieferantenkode() { return iReindersLieferantenkode; }
	public void setReindersLieferantenkode(String value)
	{
		try
		{
			String lValue = iReindersLieferantenkode;
			if (log4j.isDebugEnabled()) log4j.debug("setReindersLieferantenkode: " + lValue + " -> " + value);
			fireVetoableChange(REINDERSLIEFERANTENKODE_PROPERTY_ID, lValue, value);
			iReindersLieferantenkode = value;
			firePropertyChange(REINDERSLIEFERANTENKODE_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="reinders_lieferantenkode")
	private String iReindersLieferantenkode = null;
	final static public String REINDERSLIEFERANTENKODE_PROPERTY_ID = "reindersLieferantenkode";
	final static public Class REINDERSLIEFERANTENKODE_PROPERTY_CLASS = String.class;
	final static public String REINDERSLIEFERANTENKODE_NAME = "ReindersLieferantenkode"; // with this ID you can access the internationalization


	// ===============================================================================================
	// Clone

	/** clone */
	public Object clone()
	{ 
		nl.reinders.bm.Relation lNew = new nl.reinders.bm.Relation();
		lNew.setDeliveryAddress( getDeliveryAddress() ); 
		lNew.setBtw( getBtw() ); 
		lNew.setCurrency( getCurrency() ); 
		lNew.setDeliveryRelation( getDeliveryRelation() ); 
		lNew.setRelationgroup( getRelationgroup() ); 
		lNew.setRetour( getRetour() ); 
		lNew.setName( getName() ); 
		lNew.setHaspriceagreement( getHaspriceagreement() ); 
		lNew.setAllowBuyorder( getAllowBuyorder() ); 
		lNew.setAllowSellorder( getAllowSellorder() ); 
		lNew.setAllowBackorders( getAllowBackorders() ); 
		lNew.setExternalnr( getExternalnr() ); 
		lNew.setRitnr( getRitnr() ); 
		lNew.setInfo( getInfo() ); 
		lNew.setInternalnr( getInternalnr() ); 
		lNew.setRabatt( getRabatt() ); 
		lNew.setBez( getBez() ); 
		lNew.setSkonto( getSkonto() ); 
		lNew.setGrootboeknr( getGrootboeknr() ); 
		lNew.setRelationnr2( getRelationnr2() ); 
		lNew.setBtwnummer( getBtwnummer() ); 
		lNew.setOfficeid( getOfficeid() ); 
		lNew.setIncassobanknr( getIncassobanknr() ); 
		lNew.setIncassoreknr( getIncassoreknr() ); 
		lNew.setIncassodagen( getIncassodagen() ); 
		lNew.setShortname( getShortname() ); 
		lNew.setOfficegroupid( getOfficegroupid() ); 
		lNew.setSkontodagen( getSkontodagen() ); 
		lNew.setTobepaidwithin( getTobepaidwithin() ); 
		lNew.setBanknaam( getBanknaam() ); 
		// not cloning this column: lNew.setDwhmodified( getDwhmodified() ); 
		// not cloning this column: lNew.setDwhby( getDwhby() ); 
		lNew.setBelastingnr( getBelastingnr() ); 
		lNew.setIstransport( getIstransport() ); 
		lNew.setAgreementInfo( getAgreementInfo() ); 
		lNew.setPaymentAgreement( getPaymentAgreement() ); 
		lNew.setReindersLieferantenkode( getReindersLieferantenkode() ); 
		return lNew;
	}
	public nl.reinders.bm.Relation cloneShallow() { return (nl.reinders.bm.Relation)clone();}


	// =========================================================================================
	// Comparable

	/**
	 * default compare on primary key
	 */
	public int compareTo(nl.reinders.bm.Relation o)
	{
		if (this.getRelationnr() == null) return -1;
		if (o == null) return 1;
		return this.getRelationnr().compareTo( o.getRelationnr() );
	}


	// =========================================================================================
	// DAO

	/**
	 * @param relationnr
	 */
	static public nl.reinders.bm.Relation findByPK(Integer relationnr)
	{
		EntityManager lEntityManager = org.tbee.util.jpa.EntityManagerFinder.findEntityManager();
		if (log4j.isDebugEnabled()) log4j.debug("Using EM #" + Integer.toHexString( lEntityManager.hashCode() ) );
		Query lQuery = lEntityManager.createQuery("select t from Relation t where t.iRelationnr=:relationnr");
		lQuery.setParameter("relationnr", relationnr);
		java.util.List<nl.reinders.bm.Relation> lList = lQuery.getResultList();
	    if (lList.size() == 0) return null;
	    return lList.get(0);
	}

	/**
	 * find all entities
	 */
	static public java.util.List<nl.reinders.bm.Relation> findAll()
	{
		return findAllOrderedBy(null);
	}

	/**
	 * find all entities ordered by
	 */
	static public java.util.List<nl.reinders.bm.Relation> findAllOrderedBy(String orderedBy)
	{
		EntityManager lEntityManager = org.tbee.util.jpa.EntityManagerFinder.findEntityManager();
		if (log4j.isDebugEnabled()) log4j.debug("Using EM #" + Integer.toHexString( lEntityManager.hashCode() ) );
		Query lQuery = lEntityManager.createQuery("select t from Relation t" + (orderedBy == null ? "" : " order by t." + orderedBy) + "");
		java.util.List<nl.reinders.bm.Relation> lList = lQuery.getResultList();
	    return lList;
	}


	// =========================================================================================
	// EQUALS

	/**
	 *
	 */
	public boolean equals(Object o)
	{
		if (o == null) return false;
		if (!(o instanceof nl.reinders.bm.Relation)) return false;
		nl.reinders.bm.Relation lOther = (nl.reinders.bm.Relation)o;
		if (
			this.getRelationnr() != null && lOther.getRelationnr() != null
		)
		{
			return
				   this.getRelationnr().equals( lOther.getRelationnr() )
			;
		}
		else
			return super.equals(o);
	}



	// =========================================================================================
	// CONVIENIENCE

	/**
	 *
	 */
	public String toString()
	{
		StringBuffer lStringBuffer = new StringBuffer();
		lStringBuffer.append(super.toString());
		lStringBuffer.append(", Relationnr="); lStringBuffer.append(getRelationnr());
		return lStringBuffer.toString();
	}


	/**
	 * Using the Internationalization class
	 */
	static public String translate(String id)
	{
		return org.tbee.util.Internationalization.getInternationalization().translate(nl.reinders.bm.Relation.class, id);
	}
}
