|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.ojb.broker.util.SqlHelper
public class SqlHelper
Helper class for all SQL related stuff.
Nested Class Summary | |
---|---|
static class |
SqlHelper.PathInfo
Helper Class for a split column ie: sum (distinct amount) as theAmount |
Field Summary | |
---|---|
static String |
OJB_CLASS_COLUMN
define the name of the pseudo column holding the class to be instantiated. |
Constructor Summary | |
---|---|
SqlHelper()
|
Method Summary | |
---|---|
static String |
cleanPath(String aPath)
remove functions and () from path ie: avg(amount) -> amount ie: sum (accounts.amount) -> accounts.amount ie: count(distinct id) as theCount-> id |
static String |
getOjbClassName(ResultSet rs)
Returns the name of the class to be instantiated. |
static SqlHelper.PathInfo |
splitPath(String aPath)
Split a path into column , prefix and suffix, the prefix contains all info up to the column ie: avg(amount) -> amount , avg( , ) ie: sum (accounts.amount) as theSum -> accounts.amount , sum( , ) as theSum ie: count( distinct id ) as bla -> id , count(distinct , ) as bla Supports simple expressions ie: price * 1.05 TODO: cannot resolve multiple attributes in expression ie: price - bonus |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String OJB_CLASS_COLUMN
Constructor Detail |
---|
public SqlHelper()
Method Detail |
---|
public static String cleanPath(String aPath)
aPath
- the path to the attributepublic static SqlHelper.PathInfo splitPath(String aPath)
aPath
-
public static String getOjbClassName(ResultSet rs)
rs
- the Resultset
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |