|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.youyounet.db.SimpleBean
SimpleBean is a class which can set and get unlimited number of properties.
The property value from the get method will all have type Object
.
Users should cast that property value to the appropriate type. To set the property
that is of Java primitive type, users should wrap the primitive type property value
into a corresponding wrap class, for example:
asimplebean.set("id", new Integer(100));
Field Summary | |
protected static java.util.logging.Logger |
log
|
protected java.util.HashMap |
properties
|
Constructor Summary | |
SimpleBean()
constructor. |
Method Summary | |
void |
clear()
Clear all the properties of the bean. |
void |
create(java.lang.String table)
Insert the bean to the database table specified. |
void |
create(java.lang.String table,
DBContext c)
Insert the bean to the database table specified. |
java.lang.Object |
get(java.lang.String propertyName)
Get the property value of the property named propertyName. |
void |
set(java.lang.String propertyName,
java.lang.Object object)
Set the property value of the property named propertyName. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static java.util.logging.Logger log
protected java.util.HashMap properties
Constructor Detail |
public SimpleBean()
Method Detail |
public java.lang.Object get(java.lang.String propertyName)
propertyName
- the name of the property whose value will be fetched.
Object
, users should cast that
to the appropriate type.public void set(java.lang.String propertyName, java.lang.Object object)
propertyName
- the name of the property whose value will be set.object
- the property value. If it has Java primitive type, it should
be wrapped into a corresponding wrap class.public void create(java.lang.String table) throws java.sql.SQLException, DataTransferException
table
- the name of the database table that this SimpleBean object will
be inserted.
java.sql.SQLException
- if database error occured.
DataTransferException
- if other error occured.public void create(java.lang.String table, DBContext c) throws java.sql.SQLException, DataTransferException
table
- the name of the database table that this SompleBean object will
be inserted.c
- this create operation is part of the transaction associated with this
DBContext object.
java.sql.SQLException
- if database error occured.
DataTransferException
- if other error occured.public void clear()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |