// 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;
/*
 * $Id: NationalRegisterDeceasedBusinessBean.java,v 1.2 2007/01/12 21:57:39 idegaweb Exp $
 * Created on Nov 21, 2006
 *
 * Copyright (C) 2006 Idega Software hf. All Rights Reserved.
 *
 * This software is the proprietary information of Idega hf.
 * Use is subject to license terms.
 */
package is.idega.block.nationalregister.business;


public class NationalRegisterDeceasedBusinessBean extends IBOServiceBean implements NationalRegisterDeceasedBusiness{
	
	public NationalRegisterDeceased getEntryBySSN(String ssn) {
		try {
			Collection c = getNationalRegisterDeceasedHome().findAllBySSN(ssn);

			if (c != null) {
				Iterator it = c.iterator();
				if (it.hasNext()) {
					return (NationalRegisterDeceased) it.next();
				}
			}
		}
		catch (RemoteException e) {
			e.printStackTrace(System.err);
		}
		catch (FinderException e) {
			e.printStackTrace(System.err);
		}

		return null;
	}
	
	public boolean updateEntry(
			String symbol,
			String ssn,
			String dateOfDeath,
			String name,
			String street,
			String commune,
// 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;

/*
 * $Id: NationalRegisterDeceasedBusinessBean.java,v 1.2 2007/01/12 21:57:39 idegaweb Exp $
 * Created on Nov 21, 2006
 *
 * Copyright (C) 2006 Idega Software hf. All Rights Reserved.
 *
 * This software is the proprietary information of Idega hf.
 * Use is subject to license terms.
 */
package is.idega.block.nationalregister.business;


public class NationalRegisterDeceasedBusinessBean extends IBOServiceBean implements NationalRegisterDeceasedBusiness{
	
	public NationalRegisterDeceased getEntryBySSN(String ssn) {
		try {
			Collection c = getNationalRegisterDeceasedHome().findAllBySSN(ssn);

			if (c != null) {
				Iterator it = c.iterator();
				if (it.hasNext()) {
					return (NationalRegisterDeceased) it.next();
				}
			}
		}
		catch (RemoteException e) {
			e.printStackTrace(System.err);
		}
		catch (FinderException e) {
			e.printStackTrace(System.err);
		}

		return null;
	}
	
	public boolean updateEntry(
			String symbol,
			String ssn,
			String dateOfDeath,
			String name,
			String street,
			String commune,
			String gender,