|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.w3c.tools.jdbc.JdbcBeanSerializer
public class JdbcBeanSerializer
Read http://www.w3.org/Jigsaw/Doc/Programmer/jspdb.html to know how to use this class.
Field Summary | |
---|---|
protected JdbcBeanInterface |
bean
Our bean. |
protected static int |
EXCEPT
|
protected JdbcBeanSerializer |
except_serializer
|
protected static int |
INTERSECT
|
protected JdbcBeanSerializer |
intersect_serializer
|
protected static int |
NOTHING
INTERSECT, UNION, EXCEPT. |
protected int[] |
priority
|
protected java.sql.ResultSet |
result
The ResultSet |
protected static int |
UNION
|
protected JdbcBeanSerializer |
union_serializer
|
Constructor Summary | |
---|---|
JdbcBeanSerializer(JdbcBeanInterface bean)
Constructor |
Method Summary | |
---|---|
void |
clean()
Clean cached properties (relative to our bean) |
protected java.lang.String |
computeSQLCount(boolean all,
boolean distinct,
java.lang.String[] properties)
|
protected java.lang.String |
computeSQLDelete()
|
protected java.lang.String |
computeSQLInsert()
Compute the SQL request necessary to update the Database. |
protected java.lang.String |
computeSQLSelect(java.lang.String[] orderby,
boolean[] asc,
boolean all,
java.lang.String select,
java.lang.String[] properties)
|
protected java.lang.String |
computeSQLUpdate(java.lang.String[] primarykeys)
|
int |
count()
Count the number or row with columns matching the value of the bean properties. |
int |
count(boolean all)
Count the number or row with columns matching the value of the bean properties. |
int |
count(boolean all,
boolean distinct)
Count the number or row with columns matching the value of the bean properties |
int |
count(boolean all,
boolean distinct,
java.lang.String[] properties)
Count the number or row with columns matching the value of the given properties. |
int |
count(java.lang.String[] properties)
Count the number or row with columns matching the value of the given properties. |
boolean |
delete()
Delete the row relative to the current bean. |
JdbcBeanSerializer |
except(JdbcBeanInterface ebean)
USE THIS METHOD ONLY BEFORE SELECT QUERIES. |
protected void |
finalize()
Called by the Garbage Collector. |
boolean |
first()
Go to the first row |
protected JdbcServer |
getJdbcServer()
|
void |
initBean()
Restore default value except for JdbcBean properties. |
boolean |
insert()
Insert the current bean values in the associated table. |
JdbcBeanSerializer |
intersect(JdbcBeanInterface ibean)
USE THIS METHOD ONLY BEFORE SELECT QUERIES. |
boolean |
isLast()
Did we reached the last row? |
protected boolean |
isModified()
|
protected void |
markModified(boolean modified)
|
boolean |
next()
Update our bean with the value of the next row |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
PropertyChangeListener implementation: This method gets called when a bound property is changed. |
void |
removeExceptBean()
Remove the except bean |
void |
removeIntersectBean()
Remove the intersect bean |
void |
removeUnionBean()
Remove the union bean |
void |
select()
Perform a sql select to update the beans properties. |
void |
select(boolean all)
Perform a sql select to update the beans properties. |
void |
select(java.lang.String orderby)
Perform a sql select to update the beans properties. |
void |
select(java.lang.String[] orderby)
Perform a sql select to update the beans properties. |
void |
select(java.lang.String[] orderby,
boolean[] asc,
boolean all,
boolean distinct)
Perform a sql select to update the beans properties. |
void |
select(java.lang.String[] orderby,
boolean[] asc,
boolean all,
boolean distinct,
java.lang.String[] toselect)
Perform a sql select to update the beans properties. |
void |
select(java.lang.String orderby,
boolean asc,
boolean all)
Perform a sql select to update the beans properties. |
void |
select(java.lang.String orderby,
boolean asc,
boolean all,
boolean distinct)
Perform a sql select to update the beans properties. |
void |
selectDistinct(java.lang.String column)
Perform a sql select to update only the given columns. |
JdbcBeanSerializer |
union(JdbcBeanInterface ubean)
USE THIS METHOD ONLY BEFORE QUERIES. |
boolean |
update(java.lang.String primarykey)
Update the row relative to our bean. |
boolean |
update(java.lang.String[] primarykeys)
Update the row relative to our bean. |
void |
updateProperties(JdbcBeanInterface ubean)
Update our bean property with the given bean property (must be an instance of the same class). |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected JdbcBeanInterface bean
protected static final int NOTHING
protected static final int INTERSECT
protected static final int UNION
protected static final int EXCEPT
protected int[] priority
protected JdbcBeanSerializer intersect_serializer
protected JdbcBeanSerializer union_serializer
protected JdbcBeanSerializer except_serializer
protected java.sql.ResultSet result
Constructor Detail |
---|
public JdbcBeanSerializer(JdbcBeanInterface bean)
bean
- the JdbcBean to serializeMethod Detail |
---|
protected void markModified(boolean modified)
protected boolean isModified()
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
evt
- A PropertyChangeEvent object describing the event source
and the property that has changed.protected java.lang.String computeSQLCount(boolean all, boolean distinct, java.lang.String[] properties)
protected java.lang.String computeSQLSelect(java.lang.String[] orderby, boolean[] asc, boolean all, java.lang.String select, java.lang.String[] properties)
protected java.lang.String computeSQLInsert()
protected java.lang.String computeSQLDelete()
protected java.lang.String computeSQLUpdate(java.lang.String[] primarykeys)
protected JdbcServer getJdbcServer()
public int count()
public int count(java.lang.String[] properties)
properties
- The property names
public int count(boolean all)
all
- (join with associated beans?)
public int count(boolean all, boolean distinct)
all
- (join with associated beans?)distinct
- (SELECT DISTINCT?)
public int count(boolean all, boolean distinct, java.lang.String[] properties)
all
- (join with associated beans?)distinct
- (SELECT DISTINCT?)properties
- The property names
public void select()
public void select(boolean all)
all
- join with attached beans? (default is true)public void select(java.lang.String orderby)
orderby
- orderby rulepublic void select(java.lang.String orderby, boolean asc, boolean all)
orderby
- orderby ruleasc
- boolean if true orderby is ASC if false it it
DESC (relative to the orderby[] parameter)all
- join with attached beans? (default is true)public void select(java.lang.String orderby, boolean asc, boolean all, boolean distinct)
orderby
- orderby ruleasc
- boolean if true orderby is ASC if false it it
DESC (relative to the orderby[] parameter)all
- join with attached beans? (default is true)distinct
- if true, result won't have duplicate row (default is
false)public void select(java.lang.String[] orderby)
orderby
- array of orderby rules (ASC by default)public void select(java.lang.String[] orderby, boolean[] asc, boolean all, boolean distinct)
orderby
- array of orderby rulesasc
- array of boolean if true orderby is ASC if false it it
DESC (relative to the orderby[] parameter)all
- join with attached beans? (default is true)distinct
- if true, result won't have duplicate row (default is
false)public void select(java.lang.String[] orderby, boolean[] asc, boolean all, boolean distinct, java.lang.String[] toselect)
orderby
- array of orderby rulesasc
- array of boolean if true orderby is ASC if false it it
DESC (relative to the orderby[] parameter)all
- join with attached beans? (default is true)distinct
- if true, result won't have duplicate row (default istoselect
- array of columns name to select
false)public void selectDistinct(java.lang.String column)
column
- the bean property to updatepublic JdbcBeanSerializer intersect(JdbcBeanInterface ibean)
ibean
- the intersect beanpublic JdbcBeanSerializer union(JdbcBeanInterface ubean)
ibean
- the intersect beanpublic JdbcBeanSerializer except(JdbcBeanInterface ebean)
ibean
- the intersect beanpublic void removeIntersectBean()
public void removeUnionBean()
public void removeExceptBean()
public boolean insert()
public boolean update(java.lang.String primarykey)
primarykey
- The primary key of the SQL table
public boolean update(java.lang.String[] primarykeys)
primarykey
- The primary key of the SQL table
public boolean delete()
public boolean first()
public boolean next()
public boolean isLast()
public void clean()
public void initBean()
public void updateProperties(JdbcBeanInterface ubean)
ubean
- the bean to get new propertiesprotected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |