kea.busfw
Class BusFactory

java.lang.Object
  |
  +--kea.busfw.BusFactory

public class BusFactory
extends java.lang.Object

the BusinessFactory create or get a BusEntity Object.

Intent

Features

Architecture

Example

Author:
bingfeng zhang

Field Summary
protected  java.util.Hashtable entityPools
          the pool cache entity
protected static BusFactory instance
          a instance of BusinessFactory
protected  java.lang.String JDBC_DRIVER
          jdbc driver
 
Constructor Summary
protected BusFactory()
          declared the construction method is private
 
Method Summary
 BusEntity create(java.lang.String entityName)
          create an entity and create the entity id
 BusEntity generateBusEntity(java.lang.String entityName, java.lang.String id)
          generate business entity object from database
 java.util.List getEntitiyByCriteria(java.lang.String entityName, java.lang.String criteria)
          get business entities list
 BusEntity getEntity(java.lang.String entityName, java.lang.String id)
          get a Business Entity Object
protected  java.util.Map getEntityPool(java.lang.String entityName)
          get entity pool
static BusFactory getInstance()
          get a BusinessFactory instance the method through which this class is accessed
protected  java.lang.Object getValue(java.sql.ResultSet rs, java.lang.String columnName, int dataType)
          get a column value from ResultSet of jdbc
protected  BusEntity newBusEntity(java.lang.String entityName, java.sql.ResultSet rs)
          create new entity and fill it with ResultSet
 boolean update(BusEntity entity)
          update the Entity
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

entityPools

protected java.util.Hashtable entityPools
the pool cache entity

instance

protected static BusFactory instance
a instance of BusinessFactory

JDBC_DRIVER

protected final java.lang.String JDBC_DRIVER
jdbc driver
Constructor Detail

BusFactory

protected BusFactory()
declared the construction method is private
Method Detail

getInstance

public static BusFactory getInstance()
get a BusinessFactory instance the method through which this class is accessed
Returns:
a BusinessFactory instance

getEntity

public BusEntity getEntity(java.lang.String entityName,
                           java.lang.String id)
get a Business Entity Object
Parameters:
entityName - a entity name
entityid - a entity id
Returns:
a business entity object

getEntitiyByCriteria

public java.util.List getEntitiyByCriteria(java.lang.String entityName,
                                           java.lang.String criteria)
get business entities list
Parameters:
entityName - a entity name
criteria - a query criteria
Returns:
List query result

generateBusEntity

public BusEntity generateBusEntity(java.lang.String entityName,
                                   java.lang.String id)
generate business entity object from database
Parameters:
entityName - a entity name
criteria - a condition String

newBusEntity

protected BusEntity newBusEntity(java.lang.String entityName,
                                 java.sql.ResultSet rs)
create new entity and fill it with ResultSet
Parameters:
rs - a jdbc ResultSet
Returns:
BusEntity a new

getValue

protected java.lang.Object getValue(java.sql.ResultSet rs,
                                    java.lang.String columnName,
                                    int dataType)
get a column value from ResultSet of jdbc
Parameters:
columnName - a column name
dataType - a column data type

getEntityPool

protected java.util.Map getEntityPool(java.lang.String entityName)
get entity pool
Parameters:
entityName - a entity name
Returns:
Map entity pool

create

public BusEntity create(java.lang.String entityName)
create an entity and create the entity id
Parameters:
entityName - a entity name
Returns:
BusEntity a new entity

update

public boolean update(BusEntity entity)
update the Entity
Parameters:
entity - a entity Object
Returns:
boolean true sucessed or false failed


Copyright #169; 2000 Kea team. All Rights Reserved.