JDBaccess API 1.0

com.jdbaccess.da
Interface DataAccess

All Known Subinterfaces:
Call, Delete, Function, Insert, Procedure, Select, Update

public interface DataAccess

Super interface for all types of data access such as Insert, Update, Delete, Select and Call (Function, Procedure).


Method Summary
 void end()
          Terminate the data access object, so that it can be moved to the internal cache (in statement pool) for later reuse
 java.lang.String getName()
          Get the name of the data access object.
 java.lang.String getObjectType()
          Get the object type of the data access object.
 java.lang.String getPackageName()
          Get the package name of the data access object.
 java.lang.Long getSize()
          Get the size of the data access object.
 java.lang.String getSql()
          Get the sql string of the data access object.
 void setName(java.lang.String name)
          Set the name of the data access
 void setObjectType(java.lang.String objectType)
          Set the object type of the data access.
 void setPackageName(java.lang.String packageName)
          Set the package name of the data access for structuring the data access objects
 void setParameters(java.util.ArrayList parameters)
          Set parameters to the data access object.
 void setSql(java.lang.String sqlString)
          Set the sql string of the data access
 java.lang.String toString()
          Get the string representation of the data access object
 

Method Detail

setName

void setName(java.lang.String name)
Set the name of the data access

Parameters:
name - of data access e.g. ByName

setSql

void setSql(java.lang.String sqlString)
Set the sql string of the data access

Parameters:
sqlString - e.g. select * from employee where name = ?

setObjectType

void setObjectType(java.lang.String objectType)
Set the object type of the data access. Often the result type of the data access or the underlying table name

Parameters:
objectType - e.g. employee

setPackageName

void setPackageName(java.lang.String packageName)
Set the package name of the data access for structuring the data access objects

Parameters:
packageName - e.g. com.your_domain_your_product.employee.business.db

end

void end()
         throws ApplicationException
Terminate the data access object, so that it can be moved to the internal cache (in statement pool) for later reuse

Throws:
ApplicationException

getSize

java.lang.Long getSize()
                       throws ApplicationException
Get the size of the data access object.

Returns:
Select: size of underlying result; Insert, Update, Delete: update count after execution; Function and Procedure: update count after execution (if it has no CallResults)
Throws:
ApplicationException

setParameters

void setParameters(java.util.ArrayList parameters)
Set parameters to the data access object. The order of the elements in the ArrayList has to be the same as the order of all "?" in the underlying sql string. If transfer objects are set, parameters are set automatically so you should not use this method in this case.

Parameters:
parameters - as an ArrayList

getPackageName

java.lang.String getPackageName()
Get the package name of the data access object.

Returns:
packageName: e.g. com.your_domain_your_product.employee.business.db

getName

java.lang.String getName()
Get the name of the data access object.

Returns:
name: e.g. ByName

getObjectType

java.lang.String getObjectType()
Get the object type of the data access object. Often the result type of the data access or the underlying table name

Returns:
objectType: e.g. employee

getSql

java.lang.String getSql()
Get the sql string of the data access object.

Returns:
sql string: e.g. select * from employee where name = ?

toString

java.lang.String toString()
Get the string representation of the data access object

Overrides:
toString in class java.lang.Object
Returns:
string representation of the data access object

JDBaccess API 1.0

Copyright © 2005-2006 JDBaccess.com, Königsweg 210, D-14129 Berlin, Germany. All Rights Reserved.