input
stringlengths 10
828
| output
stringlengths 5
107
|
|---|---|
public relation get relation string aliaslocal string alias joined return relation relations get aliaslocal alias joined
|
retrieve the relation bean for between two aliases
|
public data object meta data get meta data return data object meta data this definitions get this get definition name
|
retrieve the database objects metadata
|
public map get all relations return collections unmodifiable map relations
|
retrieve a list of all relations
|
public joined data object meta data get join meta data return joined data object meta data get meta data
|
type safe return to the metadata for internal use
|
public list get sqlrelation list return this sql relation list
|
retrieve a list of precalculated relations for the where clauses
|
public string get primary alias list l this get aliases in order if l size 0 throw new illegal argument exception no primary alias defined return string l get 0
|
retrieve the short name of the primary data object
|
private jdbcdata object get primary data object string short name this get primary alias return jdbcdata object this my data objects get short name
|
retrieve the primary data object
|
public void set offset record int new offset throws dbexception if new offset 0 throw new dbexception offset records can t be less than 0 offset record new offset
|
specifies the number of records that should be skipped over before any
|
public int get offset record return offset record
|
gets the number of records that be skipped
|
public data query interface get query interface throw new java lang unsupported operation exception method get query interface not yet implemented
|
retrieve the query interface
|
public string get status joined data object meta data metadata joined data object meta data this get meta data string alias metadata get primary alias jdbcdata object primary object null try primary object this get by short name alias return primary object get status catch data exception ex log error error dataobject by name alias ex return
|
retrieve the status of the data object
|
public void add item cache entry new item increment access count if log is debug enabled log debug cache get name added item new item get key try cache lock write lock acquire catch interrupted exception ex log error interrupted waiting for write lock aborting method ex return try simply put it in lrumap if maxsize is needed takes care of removing the least recently used items cache contents put new item get key new item new item clear used count finally cache lock write lock release add item cache entry
|
adds an item to this cache
|
public void set status string new value joined data object meta data metadata joined data object meta data this get meta data string alias metadata get primary alias jdbcdata object primary object null try primary object this get by short name alias primary object set status new value catch data exception ex log error error dataobject by name alias ex
|
sets the status of the joined data object
|
public void clear try cache lock write lock acquire catch interrupted exception ex log error interrupted waiting for write lock aborting method ex return try if max size 0 cache contents java util collections synchronized map new lrumap max size else cache contents java util collections synchronized map new hash map finally cache lock write lock release clear
|
clear the cache by creating a new map
|
public cacheable get item string item key locking isn t necessary since we get the cache entry through an embedded lock cache entry one item this get cache entry item key if one item null return null if one item get contents null if log is debug enabled log debug item item key had null contents return one item get contents get item string
|
get an item as defined by the key
|
public int get item count int returnvalue 0 try cache lock read lock acquire catch interrupted exception ex log error interrupted waiting for write lock aborting method ex return 0 try returnvalue cache contents size finally cache lock read lock release return returnvalue get item count
|
get the number of items in the cache
|
public boolean is ordered return false
|
retrieve whether the cache instance is an ordered cache list based
|
public void set items java util list new items throws cache exception if new items instanceof java util vector set items new items else set items new vector new items
|
eventually the new way to set items
|
public void remove attribute string attribute name attributes remove attribute name
|
removes an attribute from this particular database object
|
public void clear synchronized cache contents cache contents new vector clear
|
clear method comment
|
public list get valid values list string field name throws dbexception joined data object meta data metadata this get join meta data string location metadata get object and field field name data object dataobject data object this my data objects get location 0 return dataobject get valid values list location 1
|
retrieve a list of valid value object for this particular dbobject
|
public cache entry get cache entry string item key cache entry one item null synchronized cache contents for enumeration all items cache contents elements all items has more elements one item cache entry all items next element if one item get key equals item key if one item is expired remove item one item get contents return null one item increment used count return one item return null
|
retrieve the low level cache entry for the cache
|
public cacheable get item string item key access count cache entry one item this get cache entry item key if one item null return null else return one item get contents get item string
|
remove item method comment
|
public int get item count return cache contents size get item count
|
get item count method comment
|
public vector get items access count vector a clone null cache entry one entry null cacheable one item null synchronized cache contents if cache contents size 0 one entry cache entry cache contents get 0 if one entry is expired this clear return new vector 1 else a clone vector cache contents clone else return new vector 1 vector v new vector a clone size for enumeration e a clone elements e has more elements one entry cache entry e next element v add element one entry get contents return v get items
|
retrieves all the items in this cache may return an empty vector
|
public void set local alias string new value this local alias new value
|
sets the local alias value
|
public string get name return cache name get name
|
get name method comment
|
public long get used count return access count get used count
|
get used count method comment
|
public boolean is ordered return true
|
retrieve whether the cache instance is an ordered cache list based
|
public void remove item cacheable old item cache entry one item null for int i 0 i cache contents size i try one item cache entry cache contents element at i if one item null if one item get key equals old item get key one item clear used count synchronized cache contents cache contents remove element one item catch exception ex ignore this one we stepped out of bounds due to another thread remove item cacheable
|
remove item method comment
|
public void set items java util list new items throws cache exception if new items instanceof java util vector set items vector new items else access count clear object one object null for java util iterator e new items iterator e has next one object e next if one object instanceof cacheable cache entry ce new cache entry cacheable one object 1 add item ce else string my name this class set items vector throw new cache exception my name item in vector is of class one object get class get name which is not cacheable cannot set items return
|
eventually the new way to set items
|
public void register cache system cache system new cache cache systems add new cache if log is debug enabled log debug registering cache system object new cache to string for cleaning
|
register a cache system for iteration
|
public void set foreign alias string new value this foreign alias new value
|
sets the foreign alias value
|
public string get key return key get description
|
gets the unique key that separates the object in the cache
|
public void set local key string new value this local field new value
|
set the local key field name
|
public void set foreign key string new value this foreign field new value
|
set the foreign key field
|
public void remove attribute string field name string attribute name throws dbexception get def remove attribute field name attribute name
|
removes an attribute from a particular field
|
public string get local alias return local alias
|
retrieve the local alias
|
public int get item count string cache name java util list v get items cache name if v null return 0 return v size
|
return a count of the number of items in a cache
|
public void clear throws dbexception check initialized for iterator i this my data objects values iterator i has next jdbcdata object one obj jdbcdata object i next one obj clear
|
clears all currently loaded fields
|
public string get foreign alias return this foreign alias
|
retrieve the foreign alias
|
public void set items string cache name java util list item list throws cache exception set items cache name item list 1
|
sets a cache to have the particular items specified in item list
|
public string get local field return this local field
|
retrieve the local field
|
public string get foreign field return this foreign field
|
retrieve the foreign field
|
public void add listener string listener string listen to if listeners null listeners new hash map array list listener list array list listeners get listen to if listener list null listener list new array list listeners put listen to listener list synchronized listener list if listener list contains listener listener list add listener
|
specify a relationship between caches
|
public void adjust for memory check memory
|
instructs the cache system to adjust its usage profile based upon
|
public void clear string cache name throws cache exception notify remote cache name all clear no notify cache name notify listeners cache name
|
clears the named cache
|
public void clear throws cache exception array list caches to clear new array list clear out all the valid values for iterator it cache instances values iterator it has next cache this cache cache it next we can have null values due to multi thread usage if this cache null caches to clear add this cache clear out the individual caches for iterator ci caches to clear iterator ci has next cache this cache cache ci next clear this cache get name uses it s own write lock
|
removes all cache items for a particular data context
|
public long get used count return use count get used count
|
used for figuring out how often this has been used
|
public void set expiration long expiration if expiration 0 expires 1 else expires system current time millis expiration
|
set the expiration time for the cache entry
|
public void clear no notify cache instances new concurrent reader hash map 30
|
clears all caches in this db context but doesnt notify any listeners
|
public void clear no notify string cache name cache this cache cache cache instances get cache name if this cache null this cache clear cache instances remove cache name
|
clear the named cache but dont send the remote system notifications
|
public connection get connection throws dsexception string my name this class get connection try if ds null throw new dsexception my name cannot get a connection to database via jndi data source handle is null return ds get connection catch sqlexception se throw new dsexception my name cannot get a connection to database via jndi data source get db url se get message
|
get connection from jndi factory retrieve from the context previously set up
|
public connection get connection string username string password throws dsexception string my name this class get connection string string try if ds null throw new dsexception my name cannot get a connection to database via jndi data source handle is null return ds get connection username password catch sqlexception se throw new dsexception my name cannot get a connection to database via jndi data source get db url username password se get message
|
get connection from jndi factory retrieve from the context previously set up
|
public jndiconfig get my jndi return my jndi
|
gets the my jndi
|
public void set my jndi jndiconfig my jndi this my jndi my jndi
|
sets the my jndi
|
public boolean exists cache string cache name if cache instances null return cache instances contains key cache name else return false
|
checks to see if the cache already exists
|
protected jdbcconfig get jdbcconfig string data context throws dbexception if expresso runtime map get default runtime null try return config manager get context data context get jdbc catch com jcorporate expresso core misc configuration exception ex log error error getting configuration for context data context throw new dbexception error getting configuration for context ex else locator utils lc new locator utils expresso runtime map get default runtime dbconfig config dbconfig lc locate component data context persistence manager dbconfig if config null throw new dbexception unable to find db config in the default runtime return config get current config
|
protected method to get jdbc configurations whether running expresso runtime
|
public cache get cache string cache name return cache cache instances get cache name
|
retrieve a given cache by name
|
public statement create statement try if my connection null return null stmnt my connection create statement return stmnt catch sqlexception e log error e return stmnt create statement
|
return a statement object from this connection for compatibility
|
public array list search and retrieve list throws dbexception return search and retrieve list null
|
retrieve an unsorted array of data objects representing the results
|
private cache get cache string cache name boolean force create cache return value null try return value cache cache instances get cache name if return value null force create return value create cache cache name false if return value null log warn somebody else removed my own cache before i was able to add it catch cache exception ex log error error creating cache ex catch java util concurrent modification exception cme cme print stack trace throw cme return return value
|
get a cache as defined by the data context and cache name
|
public prepared statement create prepared statement string sql string try if my connection null return null touch if prepared statement null try prepared statement close catch sqlexception ex log warn error closing older prepared statement ex prepared statement my connection prepare statement sql string catch sqlexception e log error e return prepared statement
|
creates a code prepared statment code object
|
public void clear prepared statement if this prepared statement null try prepared statement close catch sqlexception ex log warn error clearing prepared statement ex prepared statement null
|
clear a prepared statement associated with this record
|
public boolean clear lowest cache string one cache name null cache lowest cache null cache one cache null long lowest count java lang long max value iterator cn get all cache names iterator if cn null while cn has next one cache name string cn next one cache get cache one cache name false if one cache null one cache get used count lowest count lowest cache one cache lowest count one cache get used count while
|
removed the least used cache
|
public void finalize try if is connected disconnect catch dbexception de log warn error disconconnecting connection in finalization finalize
|
disconnect abandoned connections
|
protected dbconnection build new connection throws dbexception dbconnection one connection null todo fixme refactor so that dbconnection simply takes a config jdbc bean object and have it self configure itself if db driver type equals ignore case datasource jdbcconfig my jdbc this get jdbcconfig get data context one connection new dbconnection my jdbc else one connection new dbconnection db driver db url db connect format one connection connect db login db password one connection set data context get data context one connection set id next connection id next connection id one connection set description new connection return one connection
|
creates a new database connection
|
public long get created time return this created time
|
retrieve the time that this connection was created in system time
|
public string get date time type return date time type get date time type
|
get date time type allows dbobjects to ask what the correct database
|
protected void dump debug info extensive debugging output if needed if log is debug enabled synchronized pool lock int i 0 log debug current contents for iterator conns in use values iterator conns has next dbconnection one conn dbconnection conns next i date dt new date one conn get last touched try log debug connection i one conn get description date time get date time for db dt catch dbexception ex log error error rendering date time object ex log debug waiting interval 2000 seconds for a connection to free up
|
helper function that dumps all the current contents of the in use
|
public int get requesting uid return this uid
|
retrieve the current uid definition name
|
protected boolean is full int inuse avail synchronized pool lock inuse in use size avail available size if log is debug enabled int total connections avail inuse log debug available connections avail in use connections inuse total connections total connections return inuse max pool size
|
helper function to determine if the pool is full
|
public string get dbdriver return db driver get dbdriver
|
send back the name of the jdbc driver class being used to access
|
public void set requesting uid int new uid this uid new uid for iterator i this my data objects key set iterator i has next string key string i next data object value data object my data objects get key if value instanceof securable securable value set requesting uid new uid
|
sets the uid for the operations
|
private void check initialized if is initialized throw new illegal state exception defineable data object must be initialized with set definition prior to use
|
one liner function that allows you to quickly enforce proper initialization
|
public string get dburl return db url get dburl
|
return the url field for this connection
|
public string get description return my description get description
|
returns the text description of this connection
|
protected boolean is initialized return get meta data null
|
function that checks if initialized
|
public int get id return connection id get id
|
gets the id of this connection
|
public boolean get immortal return immortal get immortal
|
gets whether or not if this connection times out
|
public boolean is initialized return initialized is initialized
|
is this connection pool initialized or does it require database
|
public long get last touched return last touched get last touched
|
get last touched method is used to tell when the last time
|
public int get max connections return max pool size
|
useful for querying the potential of the dbconnection pools status
|
public void set distinct rowset keyword string keyword unique row keyword keyword set distinct rowset keyword string
|
p sets the sql keyword to remove duplicate records
|
public string get login return my login get login
|
return the login name used to connect to the database
|
public data object get nested from field name string field name string location this get join meta data get object and field field name return data object this my data objects get location 0
|
retrieves a nested dataobject based upon the public field name that
|
public string get distinct rowset keyword return unique row keyword set distinct rowset keyword
|
gets the sql keyword to remove duplicate records
|
public void set check zero update boolean new value string my name this class set check zero update system out println my name new value new value this check zero update new value
|
sets the check zero update boolean flag for this database connection pool
|
public string get field from nested name string field name string location this get join meta data get object and field field name return location 1
|
often times field names for the external interface will be different
|
public string get password return my password get password
|
return the password string being used to connect to the database
|
public boolean get check zero update return this check zero update
|
gets the check zero update boolean flag for this database connection pool
|
public result set get result set return this my result set
|
retrieve the current result set in the connection
|
public string get field string field name throws dbexception return this get data field field name as string
|
retrieve the field value as a string
|
protected jndiconfig get jndiconfig jdbcconfig cur config throws connection pool exception if cur config instanceof com jcorporate expresso core misc config jdbc return com jcorporate expresso core misc config jdbc cur config get my jndi else root container interface runtime expresso runtime map get default runtime locator utils lc new locator utils runtime jndiconfig manager jndiconfig lc locate component this get data context persistence manager jndiconfig if manager null throw new connection pool exception unable to locate persistence manager for data context this get data context return null
|
function that retrieves the jndi config
|
public string get sql return str sql get sql
|
gets the sql string to be executed
|
public string get security protocol return security protocol
|
gets the security protocol
|
public void set security protocol string security protocol this security protocol security protocol
|
sets the security protocol
|
public string get url pkgprefixes return url pkgprefixes
|
gets the url pkgprefixes
|
public void set url pkgprefixes string url pkgprefixes this url pkgprefixes url pkgprefixes
|
sets the url pkgprefixes
|
public string get metadata name return jndiconfig
|
because we look up our metadata in the parent component we have to
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.