|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap
velosurf.context.DBReference
public class DBReference
A context wrapper for the main database connection object.
The "$db" context variable is assigned a new instance of this class at each velocity parsing.
| Field Summary | |
|---|---|
protected java.util.Map |
cache
a cache used by the generic getter - it's purpose is to avoid the creation of several attribute references for the same multivalued attribute. |
protected Database |
db
the wrapped database connection |
protected java.util.Map |
externalParams
The map of external query parameters used by children attributes |
protected UserContext |
userContext
a reference to the user context |
| Constructor Summary | |
|---|---|
protected |
DBReference()
Default constructor for use by derived classes |
|
DBReference(Database db)
Constructs a new database reference |
|
DBReference(Database db,
UserContext userContext)
Constructs a new database reference |
| Method Summary | |
|---|---|
java.lang.String |
deobfuscate(java.lang.Object value)
de-obfuscate the given value |
java.lang.Object |
get(java.lang.Object key)
Generic getter, used to access entities or root attributes by their name. |
java.lang.String |
getSchema()
get the schema |
protected void |
init(Database db)
protected initialization method |
protected void |
init(Database db,
UserContext userContext)
protected initialization method |
java.lang.String |
obfuscate(java.lang.Object value)
obfuscate the given value |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Generic setter used to set external params for children attributes |
| Methods inherited from class java.util.HashMap |
|---|
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, putAll, remove, size, values |
| Methods inherited from class java.util.AbstractMap |
|---|
equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface velosurf.sql.ReadOnlyMap |
|---|
keySet |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Field Detail |
|---|
protected Database db
protected java.util.Map cache
protected java.util.Map externalParams
protected UserContext userContext
| Constructor Detail |
|---|
protected DBReference()
public DBReference(Database db)
db - the wrapped database connection
public DBReference(Database db,
UserContext userContext)
db - the wrapped database connection| Method Detail |
|---|
protected void init(Database db)
db - database connection
protected void init(Database db,
UserContext userContext)
db - database connectionpublic java.lang.Object get(java.lang.Object key)
For attributes, the return value depends upon the type of the attribute :
get in interface java.util.Mapget in interface ReadOnlyMapget in class java.util.HashMapkey - the name of the desired entity or root attribute.
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Mapput in class java.util.HashMapkey - name of the external parametervalue - value given to the external parameter
public java.lang.String getSchema()
public java.lang.String obfuscate(java.lang.Object value)
value - value to obfuscate
public java.lang.String deobfuscate(java.lang.Object value)
value - value to de-obfuscate
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||