/*
 * 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 address.
 * @version    $Revision$
 * @author     $Author$
 */
@MappedSuperclass
abstract public class Address extends nl.reinders.bm.AbstractBean
implements java.io.Serializable
         , java.lang.Cloneable
         , Comparable<nl.reinders.bm.Address>
{
	static final long serialVersionUID = 0;
	static final String SOURCECODE_VERSION = "$Revision$";
	static org.apache.log4j.Logger log4j = org.apache.log4j.Logger.getLogger(Address.class.getName());

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

	/** Addr2AddrtypesWhereIAmAddress*/
	public void addAddr2AddrtypesWhereIAmAddress(nl.reinders.bm.Addr2Addrtype value)
	{
		if (value != null && !iAddr2AddrtypesWhereIAmAddress.contains(value))
		{
			iAddr2AddrtypesWhereIAmAddress.add(value);
			value.setAddress( (nl.reinders.bm.Address)this);
		}
	}
	public void removeAddr2AddrtypesWhereIAmAddress(nl.reinders.bm.Addr2Addrtype value)
	{
		if (value != null && iAddr2AddrtypesWhereIAmAddress.contains(value))
		{
			iAddr2AddrtypesWhereIAmAddress.remove(value);
			value.setAddress( (nl.reinders.bm.Address)null );
		}
	}
	public java.util.List<nl.reinders.bm.Addr2Addrtype> getAddr2AddrtypesWhereIAmAddress() { return iAddr2AddrtypesWhereIAmAddress; }
	@OneToMany(mappedBy = "iAddress", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Addr2Addrtype.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Addr2Addrtype> iAddr2AddrtypesWhereIAmAddress = new java.util.ArrayList<nl.reinders.bm.Addr2Addrtype>();

	/** BuyordersWhereIAmOrderAddress*/
	public void addBuyordersWhereIAmOrderAddress(nl.reinders.bm.Buyorder value)
	{
		if (value != null && !iBuyordersWhereIAmOrderAddress.contains(value))
		{
			iBuyordersWhereIAmOrderAddress.add(value);
			value.setOrderAddress( (nl.reinders.bm.Address)this);
		}
	}
	public void removeBuyordersWhereIAmOrderAddress(nl.reinders.bm.Buyorder value)
	{
		if (value != null && iBuyordersWhereIAmOrderAddress.contains(value))
		{
			iBuyordersWhereIAmOrderAddress.remove(value);
			value.setOrderAddress( (nl.reinders.bm.Address)null );
		}
	}
	public java.util.List<nl.reinders.bm.Buyorder> getBuyordersWhereIAmOrderAddress() { return iBuyordersWhereIAmOrderAddress; }
	@OneToMany(mappedBy = "iOrderAddress", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Buyorder.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Buyorder> iBuyordersWhereIAmOrderAddress = new java.util.ArrayList<nl.reinders.bm.Buyorder>();

	/** BuyordersWhereIAmPickupAddress*/
	public void addBuyordersWhereIAmPickupAddress(nl.reinders.bm.Buyorder value)
	{
		if (value != null && !iBuyordersWhereIAmPickupAddress.contains(value))
		{
			iBuyordersWhereIAmPickupAddress.add(value);
			value.setPickupAddress( (nl.reinders.bm.Address)this);
		}
	}
	public void removeBuyordersWhereIAmPickupAddress(nl.reinders.bm.Buyorder value)
	{
		if (value != null && iBuyordersWhereIAmPickupAddress.contains(value))
		{
			iBuyordersWhereIAmPickupAddress.remove(value);
			value.setPickupAddress( (nl.reinders.bm.Address)null );
		}
	}
	public java.util.List<nl.reinders.bm.Buyorder> getBuyordersWhereIAmPickupAddress() { return iBuyordersWhereIAmPickupAddress; }
	@OneToMany(mappedBy = "iPickupAddress", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Buyorder.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Buyorder> iBuyordersWhereIAmPickupAddress = new java.util.ArrayList<nl.reinders.bm.Buyorder>();

	/** BuyordersWhereIAmDeliveryAddress*/
	public void addBuyordersWhereIAmDeliveryAddress(nl.reinders.bm.Buyorder value)
	{
		if (value != null && !iBuyordersWhereIAmDeliveryAddress.contains(value))
		{
			iBuyordersWhereIAmDeliveryAddress.add(value);
			value.setDeliveryAddress( (nl.reinders.bm.Address)this);
		}
	}
	public void removeBuyordersWhereIAmDeliveryAddress(nl.reinders.bm.Buyorder value)
	{
		if (value != null && iBuyordersWhereIAmDeliveryAddress.contains(value))
		{
			iBuyordersWhereIAmDeliveryAddress.remove(value);
			value.setDeliveryAddress( (nl.reinders.bm.Address)null );
		}
	}
	public java.util.List<nl.reinders.bm.Buyorder> getBuyordersWhereIAmDeliveryAddress() { return iBuyordersWhereIAmDeliveryAddress; }
	@OneToMany(mappedBy = "iDeliveryAddress", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Buyorder.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Buyorder> iBuyordersWhereIAmDeliveryAddress = new java.util.ArrayList<nl.reinders.bm.Buyorder>();

	/** CalendarsWhereIAmAddress*/
	public void addCalendarsWhereIAmAddress(nl.reinders.bm.Calendar value)
	{
		if (value != null && !iCalendarsWhereIAmAddress.contains(value))
		{
			iCalendarsWhereIAmAddress.add(value);
			value.setAddress( (nl.reinders.bm.Address)this);
		}
	}
	public void removeCalendarsWhereIAmAddress(nl.reinders.bm.Calendar value)
	{
		if (value != null && iCalendarsWhereIAmAddress.contains(value))
		{
			iCalendarsWhereIAmAddress.remove(value);
			value.setAddress( (nl.reinders.bm.Address)null );
		}
	}
	public java.util.List<nl.reinders.bm.Calendar> getCalendarsWhereIAmAddress() { return iCalendarsWhereIAmAddress; }
	@OneToMany(mappedBy = "iAddress", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Calendar.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Calendar> iCalendarsWhereIAmAddress = new java.util.ArrayList<nl.reinders.bm.Calendar>();

	/** RelationsWhereIAmDeliveryAddress*/
	public void addRelationsWhereIAmDeliveryAddress(nl.reinders.bm.Relation value)
	{
		if (value != null && !iRelationsWhereIAmDeliveryAddress.contains(value))
		{
			iRelationsWhereIAmDeliveryAddress.add(value);
			value.setDeliveryAddress( (nl.reinders.bm.Address)this);
		}
	}
	public void removeRelationsWhereIAmDeliveryAddress(nl.reinders.bm.Relation value)
	{
		if (value != null && iRelationsWhereIAmDeliveryAddress.contains(value))
		{
			iRelationsWhereIAmDeliveryAddress.remove(value);
			value.setDeliveryAddress( (nl.reinders.bm.Address)null );
		}
	}
	public java.util.List<nl.reinders.bm.Relation> getRelationsWhereIAmDeliveryAddress() { return iRelationsWhereIAmDeliveryAddress; }
	@OneToMany(mappedBy = "iDeliveryAddress", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Relation.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Relation> iRelationsWhereIAmDeliveryAddress = new java.util.ArrayList<nl.reinders.bm.Relation>();

	/** SellordersWhereIAmBillingAddress*/
	public void addSellordersWhereIAmBillingAddress(nl.reinders.bm.Sellorder value)
	{
		if (value != null && !iSellordersWhereIAmBillingAddress.contains(value))
		{
			iSellordersWhereIAmBillingAddress.add(value);
			value.setBillingAddress( (nl.reinders.bm.Address)this);
		}
	}
	public void removeSellordersWhereIAmBillingAddress(nl.reinders.bm.Sellorder value)
	{
		if (value != null && iSellordersWhereIAmBillingAddress.contains(value))
		{
			iSellordersWhereIAmBillingAddress.remove(value);
			value.setBillingAddress( (nl.reinders.bm.Address)null );
		}
	}
	public java.util.List<nl.reinders.bm.Sellorder> getSellordersWhereIAmBillingAddress() { return iSellordersWhereIAmBillingAddress; }
	@OneToMany(mappedBy = "iBillingAddress", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Sellorder.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Sellorder> iSellordersWhereIAmBillingAddress = new java.util.ArrayList<nl.reinders.bm.Sellorder>();

	/** SellordersWhereIAmDeliveryAddress*/
	public void addSellordersWhereIAmDeliveryAddress(nl.reinders.bm.Sellorder value)
	{
		if (value != null && !iSellordersWhereIAmDeliveryAddress.contains(value))
		{
			iSellordersWhereIAmDeliveryAddress.add(value);
			value.setDeliveryAddress( (nl.reinders.bm.Address)this);
		}
	}
	public void removeSellordersWhereIAmDeliveryAddress(nl.reinders.bm.Sellorder value)
	{
		if (value != null && iSellordersWhereIAmDeliveryAddress.contains(value))
		{
			iSellordersWhereIAmDeliveryAddress.remove(value);
			value.setDeliveryAddress( (nl.reinders.bm.Address)null );
		}
	}
	public java.util.List<nl.reinders.bm.Sellorder> getSellordersWhereIAmDeliveryAddress() { return iSellordersWhereIAmDeliveryAddress; }
	@OneToMany(mappedBy = "iDeliveryAddress", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Sellorder.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Sellorder> iSellordersWhereIAmDeliveryAddress = new java.util.ArrayList<nl.reinders.bm.Sellorder>();

	/** SellordersWhereIAmSendfromAddress*/
	public void addSellordersWhereIAmSendfromAddress(nl.reinders.bm.Sellorder value)
	{
		if (value != null && !iSellordersWhereIAmSendfromAddress.contains(value))
		{
			iSellordersWhereIAmSendfromAddress.add(value);
			value.setSendfromAddress( (nl.reinders.bm.Address)this);
		}
	}
	public void removeSellordersWhereIAmSendfromAddress(nl.reinders.bm.Sellorder value)
	{
		if (value != null && iSellordersWhereIAmSendfromAddress.contains(value))
		{
			iSellordersWhereIAmSendfromAddress.remove(value);
			value.setSendfromAddress( (nl.reinders.bm.Address)null );
		}
	}
	public java.util.List<nl.reinders.bm.Sellorder> getSellordersWhereIAmSendfromAddress() { return iSellordersWhereIAmSendfromAddress; }
	@OneToMany(mappedBy = "iSendfromAddress", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Sellorder.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
	private java.util.List<nl.reinders.bm.Sellorder> iSellordersWhereIAmSendfromAddress = new java.util.ArrayList<nl.reinders.bm.Sellorder>();


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

	/** Countrycode */
	public nl.reinders.bm.Countrycodetable getCountrycode() { return iCountrycode; }
	public void setCountrycode(nl.reinders.bm.Countrycodetable value)
	{
		if (value == iCountrycode) return; // optimalisation and prevent looping
		try
		{
			nl.reinders.bm.Countrycodetable lValue = iCountrycode;
			fireVetoableChange(COUNTRYCODE_PROPERTY_ID, lValue, value);
			if (lValue != null) lValue.removeAddresssWhereIAmCountrycode( (nl.reinders.bm.Address)this );
			iCountrycode = value;
			if (value != null) value.addAddresssWhereIAmCountrycode( (nl.reinders.bm.Address)this );
			firePropertyChange(COUNTRYCODE_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.Countrycodetable.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} ) @JoinColumn(name="countrycodenr") 
	private nl.reinders.bm.Countrycodetable iCountrycode;
	final static public String COUNTRYCODE_PROPERTY_ID = "countrycode";
	final static public Class COUNTRYCODE_PROPERTY_CLASS = nl.reinders.bm.Countrycodetable.class;
	final static public String COUNTRYCODE_NAME = "Countrycode"; // with this ID you can access the internationalization
	// to make IN queryies possible
	@Column(name="countrycodenr", insertable=false, updatable=false)
	private java.math.BigDecimal iCountrycodenr = null;

	/** Relation */
	public nl.reinders.bm.Relation getRelation() { return iRelation; }
	public void setRelation(nl.reinders.bm.Relation value)
	{
		if (value == iRelation) return; // optimalisation and prevent looping
		try
		{
			nl.reinders.bm.Relation lValue = iRelation;
			fireVetoableChange(RELATION_PROPERTY_ID, lValue, value);
			if (lValue != null) lValue.removeAddresssWhereIAmRelation( (nl.reinders.bm.Address)this );
			iRelation = value;
			if (value != null) value.addAddresssWhereIAmRelation( (nl.reinders.bm.Address)this );
			firePropertyChange(RELATION_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="relationnr") 
	private nl.reinders.bm.Relation iRelation;
	final static public String RELATION_PROPERTY_ID = "relation";
	final static public Class RELATION_PROPERTY_CLASS = nl.reinders.bm.Relation.class;
	final static public String RELATION_NAME = "Relation"; // with this ID you can access the internationalization
	// to make IN queryies possible
	@Column(name="relationnr", insertable=false, updatable=false)
	private java.math.BigDecimal iRelationnr = null;



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

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

	/** Street */
	public String getStreet() { return iStreet; }
	public void setStreet(String value)
	{
		try
		{
			String lValue = iStreet;
			if (log4j.isDebugEnabled()) log4j.debug("setStreet: " + lValue + " -> " + value);
			fireVetoableChange(STREET_PROPERTY_ID, lValue, value);
			iStreet = value;
			firePropertyChange(STREET_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="street")
	private String iStreet = null;
	final static public String STREET_PROPERTY_ID = "street";
	final static public Class STREET_PROPERTY_CLASS = String.class;
	final static public String STREET_NAME = "Street"; // with this ID you can access the internationalization

	/** Zip */
	public String getZip() { return iZip; }
	public void setZip(String value)
	{
		try
		{
			String lValue = iZip;
			if (log4j.isDebugEnabled()) log4j.debug("setZip: " + lValue + " -> " + value);
			fireVetoableChange(ZIP_PROPERTY_ID, lValue, value);
			iZip = value;
			firePropertyChange(ZIP_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="zip")
	private String iZip = null;
	final static public String ZIP_PROPERTY_ID = "zip";
	final static public Class ZIP_PROPERTY_CLASS = String.class;
	final static public String ZIP_NAME = "Zip"; // with this ID you can access the internationalization

	/** City */
	public String getCity() { return iCity; }
	public void setCity(String value)
	{
		try
		{
			String lValue = iCity;
			if (log4j.isDebugEnabled()) log4j.debug("setCity: " + lValue + " -> " + value);
			fireVetoableChange(CITY_PROPERTY_ID, lValue, value);
			iCity = value;
			firePropertyChange(CITY_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="city")
	private String iCity = null;
	final static public String CITY_PROPERTY_ID = "city";
	final static public Class CITY_PROPERTY_CLASS = String.class;
	final static public String CITY_NAME = "City"; // with this ID you can access the internationalization

	/** Isbuyorder */
	public Integer getIsbuyorder() { return iIsbuyorder; }
	public void setIsbuyorder(Integer value)
	{
		try
		{
			Integer lValue = iIsbuyorder;
			if (log4j.isDebugEnabled()) log4j.debug("setIsbuyorder: " + lValue + " -> " + value);
			fireVetoableChange(ISBUYORDER_PROPERTY_ID, lValue, value);
			iIsbuyorder = value;
			firePropertyChange(ISBUYORDER_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="isbuyorder")
	private Integer iIsbuyorder = null;
	final static public String ISBUYORDER_PROPERTY_ID = "isbuyorder";
	final static public Class ISBUYORDER_PROPERTY_CLASS = Integer.class;
	final static public String ISBUYORDER_NAME = "Isbuyorder"; // with this ID you can access the internationalization

	/** Isbuyorderdefault */
	public Integer getIsbuyorderdefault() { return iIsbuyorderdefault; }
	public void setIsbuyorderdefault(Integer value)
	{
		try
		{
			Integer lValue = iIsbuyorderdefault;
			if (log4j.isDebugEnabled()) log4j.debug("setIsbuyorderdefault: " + lValue + " -> " + value);
			fireVetoableChange(ISBUYORDERDEFAULT_PROPERTY_ID, lValue, value);
			iIsbuyorderdefault = value;
			firePropertyChange(ISBUYORDERDEFAULT_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="isbuyorderdefault")
	private Integer iIsbuyorderdefault = null;
	final static public String ISBUYORDERDEFAULT_PROPERTY_ID = "isbuyorderdefault";
	final static public Class ISBUYORDERDEFAULT_PROPERTY_CLASS = Integer.class;
	final static public String ISBUYORDERDEFAULT_NAME = "Isbuyorderdefault"; // with this ID you can access the internationalization

	/** Isdelivery */
	public Integer getIsdelivery() { return iIsdelivery; }
	public void setIsdelivery(Integer value)
	{
		try
		{
			Integer lValue = iIsdelivery;
			if (log4j.isDebugEnabled()) log4j.debug("setIsdelivery: " + lValue + " -> " + value);
			fireVetoableChange(ISDELIVERY_PROPERTY_ID, lValue, value);
			iIsdelivery = value;
			firePropertyChange(ISDELIVERY_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="isdelivery")
	private Integer iIsdelivery = null;
	final static public String ISDELIVERY_PROPERTY_ID = "isdelivery";
	final static public Class ISDELIVERY_PROPERTY_CLASS = Integer.class;
	final static public String ISDELIVERY_NAME = "Isdelivery"; // with this ID you can access the internationalization

	/** Isdeliverydefault */
	public Integer getIsdeliverydefault() { return iIsdeliverydefault; }
	public void setIsdeliverydefault(Integer value)
	{
		try
		{
			Integer lValue = iIsdeliverydefault;
			if (log4j.isDebugEnabled()) log4j.debug("setIsdeliverydefault: " + lValue + " -> " + value);
			fireVetoableChange(ISDELIVERYDEFAULT_PROPERTY_ID, lValue, value);
			iIsdeliverydefault = value;
			firePropertyChange(ISDELIVERYDEFAULT_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="isdeliverydefault")
	private Integer iIsdeliverydefault = null;
	final static public String ISDELIVERYDEFAULT_PROPERTY_ID = "isdeliverydefault";
	final static public Class ISDELIVERYDEFAULT_PROPERTY_CLASS = Integer.class;
	final static public String ISDELIVERYDEFAULT_NAME = "Isdeliverydefault"; // with this ID you can access the internationalization

	/** Isbilling */
	public Integer getIsbilling() { return iIsbilling; }
	public void setIsbilling(Integer value)
	{
		try
		{
			Integer lValue = iIsbilling;
			if (log4j.isDebugEnabled()) log4j.debug("setIsbilling: " + lValue + " -> " + value);
			fireVetoableChange(ISBILLING_PROPERTY_ID, lValue, value);
			iIsbilling = value;
			firePropertyChange(ISBILLING_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="isbilling")
	private Integer iIsbilling = null;
	final static public String ISBILLING_PROPERTY_ID = "isbilling";
	final static public Class ISBILLING_PROPERTY_CLASS = Integer.class;
	final static public String ISBILLING_NAME = "Isbilling"; // with this ID you can access the internationalization

	/** Isbillingdefault */
	public Integer getIsbillingdefault() { return iIsbillingdefault; }
	public void setIsbillingdefault(Integer value)
	{
		try
		{
			Integer lValue = iIsbillingdefault;
			if (log4j.isDebugEnabled()) log4j.debug("setIsbillingdefault: " + lValue + " -> " + value);
			fireVetoableChange(ISBILLINGDEFAULT_PROPERTY_ID, lValue, value);
			iIsbillingdefault = value;
			firePropertyChange(ISBILLINGDEFAULT_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="isbillingdefault")
	private Integer iIsbillingdefault = null;
	final static public String ISBILLINGDEFAULT_PROPERTY_ID = "isbillingdefault";
	final static public Class ISBILLINGDEFAULT_PROPERTY_CLASS = Integer.class;
	final static public String ISBILLINGDEFAULT_NAME = "Isbillingdefault"; // with this ID you can access the internationalization

	/** Isvisiting */
	public Integer getIsvisiting() { return iIsvisiting; }
	public void setIsvisiting(Integer value)
	{
		try
		{
			Integer lValue = iIsvisiting;
			if (log4j.isDebugEnabled()) log4j.debug("setIsvisiting: " + lValue + " -> " + value);
			fireVetoableChange(ISVISITING_PROPERTY_ID, lValue, value);
			iIsvisiting = value;
			firePropertyChange(ISVISITING_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="isvisiting")
	private Integer iIsvisiting = null;
	final static public String ISVISITING_PROPERTY_ID = "isvisiting";
	final static public Class ISVISITING_PROPERTY_CLASS = Integer.class;
	final static public String ISVISITING_NAME = "Isvisiting"; // with this ID you can access the internationalization

	/** Isvisitingdefault */
	public Integer getIsvisitingdefault() { return iIsvisitingdefault; }
	public void setIsvisitingdefault(Integer value)
	{
		try
		{
			Integer lValue = iIsvisitingdefault;
			if (log4j.isDebugEnabled()) log4j.debug("setIsvisitingdefault: " + lValue + " -> " + value);
			fireVetoableChange(ISVISITINGDEFAULT_PROPERTY_ID, lValue, value);
			iIsvisitingdefault = value;
			firePropertyChange(ISVISITINGDEFAULT_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="isvisitingdefault")
	private Integer iIsvisitingdefault = null;
	final static public String ISVISITINGDEFAULT_PROPERTY_ID = "isvisitingdefault";
	final static public Class ISVISITINGDEFAULT_PROPERTY_CLASS = Integer.class;
	final static public String ISVISITINGDEFAULT_NAME = "Isvisitingdefault"; // with this ID you can access the internationalization

	/** Addressname */
	public String getAddressname() { return iAddressname; }
	public void setAddressname(String value)
	{
		try
		{
			String lValue = iAddressname;
			if (log4j.isDebugEnabled()) log4j.debug("setAddressname: " + lValue + " -> " + value);
			fireVetoableChange(ADDRESSNAME_PROPERTY_ID, lValue, value);
			iAddressname = value;
			firePropertyChange(ADDRESSNAME_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="addressname")
	private String iAddressname = null;
	final static public String ADDRESSNAME_PROPERTY_ID = "addressname";
	final static public Class ADDRESSNAME_PROPERTY_CLASS = String.class;
	final static public String ADDRESSNAME_NAME = "Addressname"; // 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

	/** Lon */
	public java.math.BigDecimal getLon() { return iLon; }
	public void setLon(java.math.BigDecimal value)
	{
		try
		{
			java.math.BigDecimal lValue = iLon;
			if (log4j.isDebugEnabled()) log4j.debug("setLon: " + lValue + " -> " + value);
			fireVetoableChange(LON_PROPERTY_ID, lValue, value);
			iLon = value;
			firePropertyChange(LON_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="lon")
	private java.math.BigDecimal iLon = null;
	final static public String LON_PROPERTY_ID = "lon";
	final static public Class LON_PROPERTY_CLASS = java.math.BigDecimal.class;
	final static public String LON_NAME = "Lon"; // with this ID you can access the internationalization

	/** Lat */
	public java.math.BigDecimal getLat() { return iLat; }
	public void setLat(java.math.BigDecimal value)
	{
		try
		{
			java.math.BigDecimal lValue = iLat;
			if (log4j.isDebugEnabled()) log4j.debug("setLat: " + lValue + " -> " + value);
			fireVetoableChange(LAT_PROPERTY_ID, lValue, value);
			iLat = value;
			firePropertyChange(LAT_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="lat")
	private java.math.BigDecimal iLat = null;
	final static public String LAT_PROPERTY_ID = "lat";
	final static public Class LAT_PROPERTY_CLASS = java.math.BigDecimal.class;
	final static public String LAT_NAME = "Lat"; // 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

	/** Active */
	public Integer getActive() { return iActive; }
	public void setActive(Integer value)
	{
		try
		{
			Integer lValue = iActive;
			if (log4j.isDebugEnabled()) log4j.debug("setActive: " + lValue + " -> " + value);
			fireVetoableChange(ACTIVE_PROPERTY_ID, lValue, value);
			iActive = value;
			firePropertyChange(ACTIVE_PROPERTY_ID, lValue, value);
		}
		catch (java.beans.PropertyVetoException e) { throw new java.lang.IllegalArgumentException("Value vetoed: " + e.getMessage()); }
	}
	@Column(name="active")
	private Integer iActive = 1;
	final static public String ACTIVE_PROPERTY_ID = "active";
	final static public Class ACTIVE_PROPERTY_CLASS = Integer.class;
	final static public String ACTIVE_NAME = "Active"; // with this ID you can access the internationalization


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

	/** clone */
	public Object clone()
	{ 
		nl.reinders.bm.Address lNew = new nl.reinders.bm.Address();
		lNew.setCountrycode( getCountrycode() ); 
		lNew.setRelation( getRelation() ); 
		lNew.setStreet( getStreet() ); 
		lNew.setZip( getZip() ); 
		lNew.setCity( getCity() ); 
		lNew.setIsbuyorder( getIsbuyorder() ); 
		lNew.setIsbuyorderdefault( getIsbuyorderdefault() ); 
		lNew.setIsdelivery( getIsdelivery() ); 
		lNew.setIsdeliverydefault( getIsdeliverydefault() ); 
		lNew.setIsbilling( getIsbilling() ); 
		lNew.setIsbillingdefault( getIsbillingdefault() ); 
		lNew.setIsvisiting( getIsvisiting() ); 
		lNew.setIsvisitingdefault( getIsvisitingdefault() ); 
		lNew.setAddressname( getAddressname() ); 
		lNew.setLon( getLon() ); 
		lNew.setLat( getLat() ); 
		// not cloning this column: lNew.setDwhmodified( getDwhmodified() ); 
		// not cloning this column: lNew.setDwhby( getDwhby() ); 
		lNew.setActive( getActive() ); 
		return lNew;
	}
	public nl.reinders.bm.Address cloneShallow() { return (nl.reinders.bm.Address)clone();}


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

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


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

	/**
	 * @param addressnr
	 */
	static public nl.reinders.bm.Address findByPK(Integer addressnr)
	{
		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 Address t where t.iAddressnr=:addressnr");
		lQuery.setParameter("addressnr", addressnr);
		java.util.List<nl.reinders.bm.Address> lList = lQuery.getResultList();
	    if (lList.size() == 0) return null;
	    return lList.get(0);
	}

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

	/**
	 * find all entities ordered by
	 */
	static public java.util.List<nl.reinders.bm.Address> 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 Address t" + (orderedBy == null ? "" : " order by t." + orderedBy) + "");
		java.util.List<nl.reinders.bm.Address> lList = lQuery.getResultList();
	    return lList;
	}


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

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



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

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


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