public class SqlHelper
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SqlHelper.PathInfo
Helper Class for a split column
ie: sum (distinct amount) as theAmount |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
OJB_CLASS_COLUMN
define the name of the pseudo column holding the class to be instantiated.
|
Constructor and Description |
---|
SqlHelper() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
cleanPath(java.lang.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 java.lang.String |
getOjbClassName(java.sql.ResultSet rs)
Returns the name of the class to be instantiated.
|
static SqlHelper.PathInfo |
splitPath(java.lang.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 |
public static final java.lang.String OJB_CLASS_COLUMN
public static java.lang.String cleanPath(java.lang.String aPath)
aPath
- the path to the attributepublic static SqlHelper.PathInfo splitPath(java.lang.String aPath)
aPath
- public static java.lang.String getOjbClassName(java.sql.ResultSet rs)
rs
- the Resultset(C) 2002 - 2005 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30