|
RADDY is an open source project to support
Rapid Application Development using a J2EE server (e.g. JBoss, JOnAS, Weblogic...)
and MySQL. You can create easily J2EE prototypes without write EJB CMP entity
components or use EJB QL statements. RADDY is based on EJB
2.1 BMP specifications and requires MySQL
Connector/J. RADDY is tested with the following platform: Click
here to see a complete presentation of RADDY project. (Better
displaying with MS IE 6.0)
DOWNLOAD RADDY
is licensed under the GNU General
Public License. This means that all source code, tools and documentation is
available free of charge for any purpose.
Disclaimer No
warranty or responsibility in relation to the suitability, functionality, reliability
or robustness of the software. This software is under constant revision, with
changes likely to some parts of API. All reasonable efforts are made to supply
the software without known defects or exploits, however no responsibility can
be accepted by the authors. Source
code - JAR library
Please report
any problem or request of support to freshmeat@sixtyfourbit.org Please
leave a message on my guestbook
for your feedback. RADDY
EXAMPLES FastEntity example #1
- Retrieve a record from a table: InitialContext
initCtx = new InitialContext(); FastEntityHome home = (FastEntityHome)
initCtx.lookup("com.raddy.singletable.FastEntity"); FastEntityPK
formPK=new FastEntityPK("YOUR_TABLE"); formPK.set("PRIMARY_KEY_FIELD_NAME","PRIMARY_KEY_VALUE"); FastEntity
record=home.findByPrimaryKey(formPK); Hashtable record=form.get(); Object
col1=record.get("COLUMN1"); Object col2=record.get("COLUMN2");
FastEntity example #2 - Retrieve a recordset from
a table: InitialContext initCtx
= new InitialContext(); FastEntityHome home = (FastEntityHome) initCtx.lookup("com.raddy.singletable.FastEntity"); FastEntityPK
formPK=new FastEntityPK("YOUR_TABLE"); Collection recordset=home.findAll("YOUR_TABLE","COLUMN1
= 'VALUE1' AND COLUMN2 = 'VALUE2' ","COLUMN1,COLUMN2 "); if(!recordset.isEmpty()) {
Iterator iter=recordset.iterator(); while(iter.hasNext()) {
FastEntity bean = (FastEntity) iter.next(); Hashtable record=bean.get(); Object
col1=record.get("COLUMN1"); Object col2=record.get("COLUMN2"); } }
FastEntity example #3 - Create a new record in a table:
InitialContext initCtx = new InitialContext(); FastEntityHome
home = (FastEntityHome) initCtx.lookup("com.raddy.singletable.FastEntity"); Hashtable
record= new Hashtable(); record.set("COLUMN1","VALUE1"); record.set("COLUMN2",new
Integer(5)); ReadOnlyEntity
example #4 - Retrieve a label/value pair recordset from a table:
InitialContext initCtx = new InitialContext(); ReadOnlyEntityHome
home = (ReadOnlyEntityHome) initCtx.lookup("com.raddy.readonly.ReadOnlyEntity"); ReadOnlyEntityPK
roPK=new ReadOnlyEntityPK("YOUR_TABLE","LABEL_COLUMN","VALUE_COLUMN"); roPK.set("PK_COLUMN","PK_VALUE"); ReadOnlyEntity
roBean=roHome.findByPrimaryKey(roPK); Hashtable recordset=roBean.get();
AssociationEntity
example #5 - Retrieve a recordset from an association of tables:
iInitialContext nitCtx = new InitialContext(); AssociationEntityHome
home = (AssociationEntityHome) initCtx.lookup("com.raddy.multitable.AssociationEntity"); FastEntityPK
pkX=new FastEntityPK("ASSOCIATION_TABLE"); pkX.set("ASSOCIATION_TABLE_COLUMN1","VALUE"); FastEntityPK
pkA=new FastEntityPK("TABLE_A"); pkA.set("TABLE_A_COLUMN1","VALUE"); FastEntityPK
pkB=new FastEntityPK("TABLE_B"); pkB.set("TABLE_B_COLUMN1","VALUE"); AssociationEntityPK
PK=new AssociationEntityPK(pkX,pkA,pkB); list=home.findAll(PK); if(!list.isEmpty()) {
Iterator iter=list.iterator(); while(iter.hasNext()) {
AssociationEntity entity =(AssociationEntity) iter.next(); Hashtable
X_record=entity.get(); Hashtable A_record=entity.getA(); Hashtable
B_record=entity.getB(); } }
|