// Path: src/java/is/idega/block/nationalregister/data/NationalRegisterDeceased.java
// public interface NationalRegisterDeceased extends IDOEntity {
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#setSymbol
// 	 */
// 	public void setSymbol(String symbol);
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#getSymbol
// 	 */
// 	public String getSymbol();
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#setSSN
// 	 */
// 	public void setSSN(String ssn);
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#getSSN
// 	 */
// 	public String getSSN();
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#setDateOfDeath
// 	 */
// 	public void setDateOfDeath(String date);
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#getDateOfDeath
// 	 */
// 	public String getDateOfDeath();
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#setName
// 	 */
// 	public void setName(String name);
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#getName
// 	 */
// 	public String getName();
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#setCommune
// 	 */
// 	public void setCommune(String commune);
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#getCommune
// 	 */
// 	public String getCommune();
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#setStreet
// 	 */
// 	public void setStreet(String street);
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#getStreet
// 	 */
// 	public String getStreet();
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#setGender
// 	 */
// 	public void setGender(String gender);
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#getGender
// 	 */
// 	public String getGender();
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#setMaritalStatus
// 	 */
// 	public void setMaritalStatus(String status);
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#getMaritalStatus
// 	 */
// 	public String getMaritalStatus();
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#setSpouseSSN
// 	 */
// 	public void setSpouseSSN(String ssn);
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#getSpouseSSN
// 	 */
// 	public String getSpouseSSN();
// }
// 
// Path: src/java/is/idega/block/nationalregister/data/NationalRegisterDeceasedHome.java
// public interface NationalRegisterDeceasedHome extends IDOHome {
// 
// 	public NationalRegisterDeceased create() throws CreateException;
// 
// 	public NationalRegisterDeceased findByPrimaryKey(Object pk) throws FinderException;
// 	
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#ejbFindAll
// 	 */
// 	public Collection findAll() throws FinderException, RemoteException;
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#ejbFindAllBySSN
// 	 */
// 	public Collection findAllBySSN(String ssn) throws FinderException, RemoteException;
// 
// }


import is.idega.block.nationalregister.data.NationalRegisterDeceased;
import is.idega.block.nationalregister.data.NationalRegisterDeceasedHome;
import java.rmi.RemoteException;
import java.util.Collection;
import java.util.Iterator;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import com.idega.business.IBOServiceBean;
import com.idega.data.IDOLookup;
			String gender,
			String maritialStatus,
			String spouseSSN) {
				
			try {
				NationalRegisterDeceased deceasedReg = getEntryBySSN(ssn);
				if (deceasedReg == null) {
					deceasedReg = getNationalRegisterDeceasedHome().create();
				} 

				deceasedReg.setSymbol(symbol);
				deceasedReg.setSSN(ssn);
				deceasedReg.setDateOfDeath(dateOfDeath);
				deceasedReg.setName(name);
				deceasedReg.setStreet(street);
				deceasedReg.setCommune(commune);
				deceasedReg.setGender(gender);
				deceasedReg.setMaritalStatus(maritialStatus);
				deceasedReg.setSpouseSSN(spouseSSN);
				
				deceasedReg.store();
			}
			catch (CreateException e) {
				e.printStackTrace();
				return false;
			}

			return true;
		}
	
// Path: src/java/is/idega/block/nationalregister/data/NationalRegisterDeceased.java
// public interface NationalRegisterDeceased extends IDOEntity {
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#setSymbol
// 	 */
// 	public void setSymbol(String symbol);
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#getSymbol
// 	 */
// 	public String getSymbol();
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#setSSN
// 	 */
// 	public void setSSN(String ssn);
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#getSSN
// 	 */
// 	public String getSSN();
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#setDateOfDeath
// 	 */
// 	public void setDateOfDeath(String date);
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#getDateOfDeath
// 	 */
// 	public String getDateOfDeath();
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#setName
// 	 */
// 	public void setName(String name);
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#getName
// 	 */
// 	public String getName();
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#setCommune
// 	 */
// 	public void setCommune(String commune);
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#getCommune
// 	 */
// 	public String getCommune();
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#setStreet
// 	 */
// 	public void setStreet(String street);
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#getStreet
// 	 */
// 	public String getStreet();
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#setGender
// 	 */
// 	public void setGender(String gender);
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#getGender
// 	 */
// 	public String getGender();
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#setMaritalStatus
// 	 */
// 	public void setMaritalStatus(String status);
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#getMaritalStatus
// 	 */
// 	public String getMaritalStatus();
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#setSpouseSSN
// 	 */
// 	public void setSpouseSSN(String ssn);
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#getSpouseSSN
// 	 */
// 	public String getSpouseSSN();
// }
// 
// Path: src/java/is/idega/block/nationalregister/data/NationalRegisterDeceasedHome.java
// public interface NationalRegisterDeceasedHome extends IDOHome {
// 
// 	public NationalRegisterDeceased create() throws CreateException;
// 
// 	public NationalRegisterDeceased findByPrimaryKey(Object pk) throws FinderException;
// 	
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#ejbFindAll
// 	 */
// 	public Collection findAll() throws FinderException, RemoteException;
// 
// 	/**
// 	 * @see is.idega.block.nationalregister.data.NationalRegisterDeceasedBMPBean#ejbFindAllBySSN
// 	 */
// 	public Collection findAllBySSN(String ssn) throws FinderException, RemoteException;
// 
// }


// Path: src/java/is/idega/block/nationalregister/business/NationalRegisterDeceasedBusinessBean.java
import is.idega.block.nationalregister.data.NationalRegisterDeceased;
import is.idega.block.nationalregister.data.NationalRegisterDeceasedHome;
import java.rmi.RemoteException;
import java.util.Collection;
import java.util.Iterator;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import com.idega.business.IBOServiceBean;
import com.idega.data.IDOLookup;

			String gender,
			String maritialStatus,
			String spouseSSN) {
				
			try {
				NationalRegisterDeceased deceasedReg = getEntryBySSN(ssn);
				if (deceasedReg == null) {
					deceasedReg = getNationalRegisterDeceasedHome().create();
				} 

				deceasedReg.setSymbol(symbol);
				deceasedReg.setSSN(ssn);
				deceasedReg.setDateOfDeath(dateOfDeath);
				deceasedReg.setName(name);
				deceasedReg.setStreet(street);
				deceasedReg.setCommune(commune);
				deceasedReg.setGender(gender);
				deceasedReg.setMaritalStatus(maritialStatus);
				deceasedReg.setSpouseSSN(spouseSSN);
				
				deceasedReg.store();
			}
			catch (CreateException e) {
				e.printStackTrace();
				return false;
			}

			return true;
		}
	
	protected NationalRegisterDeceasedHome getNationalRegisterDeceasedHome() {