|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.saffron.ext.ClassSchema
A ClassSchema
is a schema whose tables are reflections of the
the public fields of a given class.
Field Summary | |
private Class |
clazz
|
private boolean |
ignoreCase
|
Constructor Summary | |
ClassSchema(Class clazz,
boolean ignoreCase)
|
Method Summary | |
private Field |
findField(String name)
|
SaffronTable |
getTableForMember(String[] names)
Retrieves a SaffronTable based upon a member access. |
protected Expression |
getTarget(Expression connectionExp)
Given the expression which yields the current connection, returns an expression which yields the object which holds the schema data. |
SaffronTypeFactory |
getTypeFactory()
Returns the type factory used to generate
types for this schema. |
void |
registerRules(SaffronPlanner planner)
Registers all of the rules supported by this schema. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private final Class clazz
private final boolean ignoreCase
Constructor Detail |
public ClassSchema(Class clazz, boolean ignoreCase)
Method Detail |
public SaffronTable getTableForMember(String[] names)
SaffronSchema
SaffronTable
based upon a member access.
For example, the Saffron expression salesSchema.emps
would
be resolved using a call to
salesSchema.getTableForMember(new String[]{"emps"})
.
Note that name.length is only greater than 1 for queries originating from JDBC.
getTableForMember
in interface SaffronSchema
public SaffronTypeFactory getTypeFactory()
SaffronSchema
type factory
used to generate
types for this schema.
getTypeFactory
in interface SaffronSchema
public void registerRules(SaffronPlanner planner) throws Exception
SaffronSchema
SaffronPlanner.registerSchema(net.sf.saffron.core.SaffronSchema)
.
registerRules
in interface SaffronSchema
Exception
protected Expression getTarget(Expression connectionExp)
By default, returns the connection expression. So if the connection
expression is Variable("connection")
, it will return the
same variable, and the planner will expect to be able to cast this value
to the required class and find a field for each 'table' in the
schema.
private Field findField(String name)
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |