Channel data model provides the pre-build extensible interfaces, and uses the JPA technique to access persistent channel data. Channel data model includes Database table, Java data bean, and DAO API.
JavaBean Name | Database Table | Content | User case | Data originator |
---|---|---|---|---|
com.ibm.btt.channel.data.ChannelPolicyBase | Channel Policy Base | Channel policy base data | Read often, update/delete rarely, (read when user login | When User sign channel |
com.ibm.btt.channel.data.ChannelRuntime | Channel Runtime | User runtime behavior on channel | Read/update often, delete rarely, (read/update when user login/ transfer) | When User sign channel |
com.ibm.btt.channel.data.RegisteredAccounts | Registered Accounts | Registered Account for each channel signed(part of channel base data) | Read often, update/delete rarely, (read when user login) | When User sign channel |
com.ibm.btt.channel.data.FeePolicyBase | Fee Base | Fee related | Read often, update rarely, no delete (read when application start ) | System solution build |
com.ibm.btt.channel.data.ChannelEJ | Channel EJ | All transaction EJ for channels | High frequency Add, maintained by DB admin | Transaction |
public interface ChannelPolicyBaseDAO { public ChannelPolicyBase getChannelPolicyBase(ChannelPolicyBasePK id) ; public void addChannelPolicyBase(ChannelPolicyBase channelPolicyBase) ; public void deleteChannelPolicyBase(ChannelPolicyBasePK id) ; public void updateChannelPolicyBase(ChannelPolicyBase channelPolicyBase) ; public List<RegisteredAccounts> getRegisteredAccountsNumber(ChannelPolicyBasePK id) ; public void addRegisteredAccountsNumber(ChannelPolicyBasePK id, String[] accountNumbers) ; public void setAccountNumberAlias(ChannelPolicyBasePK id, String accountNumber, String accountAlias) ; public void removeRegisteredAccountNumber(ChannelPolicyBasePK id, String[] accountNumbers) ; }
public interface ChannelRuntimeDAO { public ChannelRuntime getChannelRuntime(ChannelRuntimePK id) ; public void addChannelRuntime(ChannelRuntime channelRuntime) ; public void deleteChannelRuntime(ChannelRuntimePK id) ; public void updateChannelRuntime(ChannelRuntime channelRuntime) ; public void increaseTransferedAmount(ChannelRuntimePK id, Double amount) ; public void increaseTransferedCount(ChannelRuntimePK id) ; public void increasePasswordErrorCount(ChannelRuntimePK id ) ; public void resetChannelRuntime(ChannelRuntimePK id ) ; public void resetChannelRuntimeAll() ; }
An instance of ChannelRuntime is responding to a line in Channel Runtime table. And ChannelRuntimePK is the key of ChannelRuntime, which including the fields:
The following codes give an example to use these interfaces:
ChannelPolicyBaseDAO baseDao=new ChannelPolicyBaseDAOImpl(); ChannelPolicyBase policybase=new ChannelPolicyBase(); policybase.setId(new ChannelPolicyBasePK("user01", "InternetBanking")); policybase.setLoginAlias("kkkk"); baseDao.addChannelPolicyBase(policybase);
In the example, a new ChannelPolicyBase instance is created in the DB. The class ChannelPolicyBaseDAOImpl is the implementation class of ChannelPolicyBaseDAO; the class ChannelRuntimeDAOImpl is the implementation class of ChannelRuntimeDAO;
BTT Channel Data Model follows the JPA standards to persist channel data. Before deploying, you should follow the JPA standards to configure the JDBC Connections. The following steps introduce how to configure:
For DB2, specify as following configuration:
<property name="openjpa.ConnectionDriverName" value="com.ibm.db2.jcc.DB2Driver" /> <property name="openjpa.ConnectionURL" value="jdbc:db2://SERVER_NAME:50000/DB_NAME" /> <property name="openjpa.ConnectionUserName" value="USER_NAME" /> <property name="openjpa.ConnectionPassword" value="USER_PASSWORD" /> </properties>
For Oracle, specify as following configuration:
<property name="openjpa.ConnectionDriverName" value="oracle.jdbc.driver.OracleDriver" /> <property name="openjpa.ConnectionURL" value="jdbc:oracle:thin:SERVER_NAME:1521:DB_NAME" /> <property name="openjpa.ConnectionUserName" value="USER_NAME" /> <property name="openjpa.ConnectionPassword" value="USER_PASSWORD" /> </properties>
For SQL Server, specify as following configuration:
<property name="openjpa.ConnectionDriverName" value=" com.microsoft.sqlserver.jdbc.SQLServerDriver " /> <property name="openjpa.ConnectionURL" value=" jdbc:sqlserver://SERVER_NAME:1433;DatabaseName=DB_NAME/> <property name="openjpa.ConnectionUserName" value="USER_NAME" /> <property name="openjpa.ConnectionPassword" value="USER_PASSWORD" /> </properties>
<jta-data-source>JNDI_of_DataSource</jta-data-source> <properties> <property name="openjpa.jdbc.Schema" value="schema_NAME" /> </properties>