it.mokabyte.pattern.dao
Interface MyDao

All Known Implementing Classes:
MyDaoJdbcImpl, MyDaoXmlImpl

public interface MyDao

Title: MyDao

Description: the dao interface

Copyright: Copyright (c) 2002

Company:

Author:
Rossini S. - Dozio L.

Method Summary
 boolean accountExists(AccountPK key)
           
 int deleteAccount(AccountPK pk)
          Delete an Account
 int insertAccount(AccountPK pk, java.lang.String name, java.lang.String address, double balance)
          Insert an Account
 AccountOM readAccount(AccountPK pk)
          Get an Account
 int updateAccount(AccountPK key, java.lang.String name, java.lang.String address, double balance)
          Update an account
 

Method Detail

insertAccount

public int insertAccount(AccountPK pk,
                         java.lang.String name,
                         java.lang.String address,
                         double balance)
                  throws DAOException
Insert an Account
Parameters:
pk - primary key for the account
name - the account user name
address - the account user address
balance - the initial balance for this account
Returns:
the number of rows inserted
Throws:
DAOException - a data access error occured

deleteAccount

public int deleteAccount(AccountPK pk)
                  throws DAOException
Delete an Account
Parameters:
the - primary key
Returns:
the number of rows deleted
Throws:
DAOException - a data access error occured

readAccount

public AccountOM readAccount(AccountPK pk)
                      throws DAOException
Get an Account
Parameters:
the - primary key
Returns:
the ObjectModel of the Account
Throws:
DAOException - a data access error occured

updateAccount

public int updateAccount(AccountPK key,
                         java.lang.String name,
                         java.lang.String address,
                         double balance)
                  throws DAOException
Update an account
Parameters:
key - the primary key
name - user name
address - user address
balance - user balance
Returns:
the number of rows updated
Throws:
DAOException - a data access error occured

accountExists

public boolean accountExists(AccountPK key)
                      throws DAOException
Parameters:
key - the Primary Key for this account
Returns:
true if account exists
Throws:
DAOException - a data access error occured