input
stringlengths
10
828
output
stringlengths
5
107
public void load throws persistency exception try db lite model db model db lite model persistent model db api db db model get db load db db model entities catch exception e log error problem with db lite entities load e get message throw new persistency exception e get message
loads the entities
public void save throws persistency exception try db lite model db model db lite model persistent model db api db db model get db delete db db model entities insert update db db model entities catch exception e log error problem with db lite entities save e get message throw new persistency exception e get message
saves the entities
private db api create db string db lite config path db config api db config new db config db lite config path db api db db get instance db config try db open catch db exception e log error opening database error in db lite model e get message return db
creates the database object
public ientities create entities ientity entity throws meta exception concept config concept config entity get concept config string entities class name concept config get entities class ientities created entities create entities entities class name if created entities null string model code model get model config get code string error error in model meta create entities ientity model code entities class name throw new meta exception error set parents created entities entity return created entities
creates entities given an entity
public db api get db return db
gets the database
public void set property string property code object property property map put property code property
sets the entity property given a property code
public property config get property config string property code property config property config null properties config properties config get properties config if properties config null property config properties config get property config property code return property config
gets the property configuration for a given property code
public ientities create entities ientities entities throws meta exception concept config concept config entities get concept config string entities class name concept config get entities class ientities created entities create entities entities class name if created entities null string model code model get model config get code string error error in model meta create entities ientities model code entities class name throw new meta exception error set parents created entities entities return created entities
creates entities given other entities
public void set neighbors config neighbors config neighbors config neighbors config set concept config this for neighbor config neighbor config neighbors config neighbor config set concept config this this neighbors config neighbors config
sets neighbors configuration
public ientities get entry ientity entity ientities entry null try if entity get concept config is entry string entry code entity get concept config get code entry model get entry entry code else ientity parent get internal parent entity if parent null entry get entry parent catch exception e log info error in model meta get entry ientity entity entity get concept config get code e get message return entry
gets the domain model entry given an entity
protected void select all throws db exception try string entity code concept config get code string select all select from entity code sql command select all sql query catch db exception dbe release throw dbe
selects all db query records
public neighbors config get neighbors config return neighbors config
gets neighbors configuration
public db query record api retrieve map primary key throws db exception try long id long primary key get col oid sql db query record api record null string entity code concept config get code string select one select from entity code where oid sql command select one sql cleanup sql argument types bigint id 0 sql query if next first and only row record current record release return record catch db exception dbe release throw dbe
retrieves a db query record with the given primary key
public neighbor config get neighbor config string neighbor code neighbor config neighbor config null neighbors config neighbors config get neighbors config if neighbors config null neighbor config neighbors config get neighbor config neighbor code return neighbor config
gets the neighbor configuration for a given neighbor code
public db query record api retrieve long oid throws db exception map primary key new hash map primary key put col oid sql oid return retrieve primary key
retrieves a db query record with the given oid unique number
public boolean update concept config concept config return false
updates the concept configuration not allowed
public boolean contains long oid throws db exception map primary key new hash map primary key put col oid sql oid return super contains primary key
checks if this database query contains a db query record with the given
public combination config get index config if index config null index config new combination config properties config properties config get properties config for ientity config properties config property config property config property config config if property config is index index config add property config get code property config neighbors config neighbors config get neighbors config for ientity config neighbors config neighbor config neighbor config neighbor config config if neighbor config is index index config add neighbor config get code neighbor config return index config
if null derives the concept index configuration that consists of index
public object get property ientity entity string property code return execute get property method entity property code
gets the entity property given an entity and a property code
public xml concept config get xml concept return xml concept
gets the xml persistent concept
public int delete db query record api record throws db exception if record null return 1 try db lite record a record db lite record record int updated rows 1 string entity code concept config get code string delete one delete from entity code where oid sql command delete one sql cleanup sql argument types bigint a record get oid 0 updated rows sql update release return updated rows catch db exception dbe release throw dbe
deletes a record from this db query
public void set neighbor ientity entity string neighbor code object neighbor execute set neighbor method entity neighbor code neighbor
sets the entity neighbor given an entity and a neighbor code
public int delete long oid throws db exception db lite record record new db lite record oid get concept config return delete record
deletes a record from this db query
public ientity get entity return xml concept get entity
gets the concept entity
public object get neighbor ientity entity string neighbor code return execute get neighbor method entity neighbor code
gets the entity neighbor given an entity and a neighbor code
protected db query record api current record throws db exception db lite record record new db lite record get concept config record set oid get column long oid properties config properties config concept config get properties config for property config property config properties config set property record property config return record
returns the current db query record
protected boolean next throws db exception try if opened if result set next return true return false else return false catch sqlexception e log error no next db raise db exception e get message db lite query next db lite query next return false
finds the next sql database query record if it exists
public boolean has external parent boolean has external parent false list neighbor config external parent config list get neighbors config get external parent config list if external parent config list size 0 has external parent true return has external parent
checks if there is at least one external parent
public ientity get parent neighbor ientity entity string neighbor code return execute get parent entity method entity neighbor code
gets the parent neighbor given an entity and a neighbor code
private void extend properties properties config properties config get properties config if properties config null for property config property config properties config property config extend
extends property configurations of the concept
private int get row count throws db exception try if result set next return result set get int 1 based on select count from table name else return 1 catch sqlexception e log error no row count db raise db exception e get message db lite query get row count db lite query get row count return 1
gets a row count
private void extend neighbors neighbors config neighbors config get neighbors config if neighbors config null for neighbor config neighbor config neighbors config neighbor config extend
extends neighbor configurations of the concept
protected void release throws db exception exception e null if opened try if result set null result set close prepared statement close catch sqlexception sqle e sqle finally super release if e null log error db query not closed db raise db exception e get message db lite query release db lite query release
releases the sql database query
public ientities get child neighbor ientity entity string neighbor code return execute get child entities method entity neighbor code
gets the child neighbor given an entity and a neighbor code
protected void sql command string sql throws db exception try if opened if db connection null db connection is opened db connection db get db connection prepared statement sql db connection db connection get connection prepare statement sql opened true catch sqlexception e log error problem with the sql command db raise db exception e get message db lite query sql command db lite query sql command
prepares an sql command for a closed sql database query
protected void sql cleanup throws db exception try if opened prepared statement clear parameters catch sqlexception e log error db query sql cleanup problem db raise db exception e get message db lite query sql cleanup db lite query sql cleanup
clears sql command parameters
protected void sql query throws db exception try if opened result set prepared statement execute query catch sqlexception e log error problem with the sql query db raise db exception e get message db lite query sql query db lite query sql query
executes an sql select command
protected int sql update throws db exception int updated rows count 1 try if opened updated rows count prepared statement execute update catch sqlexception e log error db query update problem db raise db exception e get message db lite query sql update db lite query sql update return updated rows count
executes an sql update command
protected string get column string string column name throws db exception try return result set get string column name catch sqlexception e log error no column string db raise db exception e get message db lite query get column string db lite query get column string return
gets a column string based on the column name for the current row
protected integer get column integer string column name throws db exception try string col value result set get string column name return col value null new integer col value null catch sqlexception e log error no column integer db raise db exception e get message db lite query get column integer db lite query get column integer return null
gets a column integer based on the column name for the current row
protected double get column double string column name throws db exception try string col value result set get string column name return col value null new double col value null catch sqlexception e log error no column double db raise db exception e get message db lite query get column double db lite query get column double return null
gets a column double based on the column name for the current row
protected long get column long string column name throws db exception try string col value result set get string column name return col value null new long col value null catch sqlexception e log error no column long db raise db exception e get message db lite query get column long db lite query get column long return null
gets a column long based on the column name for the current row
protected float get column float string column name throws db exception try string col value result set get string column name return col value null new float col value null catch sqlexception e log error no column float db raise db exception e get message db lite query get column float db lite query get column float return null
gets a column float based on the column name for the current row
protected short get column short string column name throws db exception try string col value result set get string column name return col value null new short col value null catch sqlexception e log error no column short db raise db exception e get message db lite query get column short db lite query get column short return null
gets a column short based on the column name for the current row
protected boolean get column boolean string column name throws db exception try string col value result set get string column name if col value null if col value equals 1 col value equals true return new boolean true else if col value equals 0 col value equals false return new boolean false return null catch sqlexception e log error no column boolean db raise db exception e get message db lite query get column boolean db lite query get column boolean return null
gets a column boolean based on the column name for the current row
protected date get column date string column name throws db exception try return result set get date column name catch sqlexception e log error no column date db raise db exception e get message db lite query get column date db lite query get column date return null
gets a column date based on the column name for the current row
public void load throws persistency exception load null null system out println kraj load a potrebno je formirati eksterne veze
loads entry entities from the db tables
public void save throws persistency exception try db api db jdbc model get db db set this db commit catch exception e log error error in jdbc entities save e get message throw new persistency exception e get message
saves the entities
protected time get column time string column name throws db exception try return result set get time column name catch sqlexception e log error no column time db raise db exception e get message db lite query get column time db lite query get column time return null
gets a column time based on the column name for the current row
public boolean update ientity entity1 ientity entity2 return update entity1 entity2 true
updates properties and neighbors of the entity1 with the entity2
protected object get column object string column name throws db exception try return result set get object column name catch sqlexception e log error no column object db raise db exception e get message db lite query get column object db lite query get column string return null
gets a column object based on the column name for the current row
protected byte get column byte string column name throws db exception try return new byte result set get byte column name catch sqlexception e log error no column byte db raise db exception e get message db lite query get column byte db lite query get column byte return null
gets a column byte based on the column name for the current row
protected void fill element element throws dm exception try entity entity entity get entity string oid string transformer string entity get oid get unique number if oid string null element add attribute oid oid string string code entity get code if code null element add element code add text code fill property children element fill neighbor children element catch exception e log error problem with xml entity fill element get name e get message throw new dm exception e get message
fills an xml element
protected array get column array string column name throws db exception try return result set get array column name catch sqlexception e log error no column array db raise db exception e get message db lite query get column array db lite query get column array return null
gets a column array based on the column name for the current row
public boolean update properties ientity entity1 ientity entity2 return update properties entity1 entity2 true
updates entity1 properties with entity2 properties of the entity1 with
protected blob get column blob string column name throws db exception try return result set get blob column name catch sqlexception e log error no column blob db raise db exception e get message db lite query get column blob db lite query get column blob return null
gets a column blob based on the column name for the current row
protected clob get column clob string column name throws db exception try return result set get clob column name catch sqlexception e log error no column clob db raise db exception e get message db lite query get column clob db lite query get column clob return null
gets a column clob based on the column name for the current row
private db api create db db db new db persistence config path db api db api new db persistence config path db db db db api db config api db config new db config persistence config path db api db db get instance db config try db open catch db exception e log error opening database error in jdbc model e get message return db
creates the database object
public db api get db return this db
gets the database
public string get persistence config path return persistence config path
gets the data directory path
public void close try db close super close catch db exception e log error closing database error in jdbc model e get message
closes the database
public boolean update neighbors ientity entity1 ientity entity2 boolean updated update parent neighbors entity1 entity2 if updated updated update child neighbors entity1 entity2 return updated
updates entity1 neighbors with entity2 neighbors
protected ref get column ref string column name throws db exception try return result set get ref column name catch sqlexception e log error no column ref db raise db exception e get message db lite query get column ref db lite query get column ref return null
gets a column ref based on the column name for the current row
public int get count db criteria api selection criteria throws db exception string sql get sqlselect count for db criteria selection criteria sql command sql set arguments for db criteria selection criteria 0 sql query return get row count
gets a count of db query records based on a database selection criteria
public void set db db api db this db db
sets the database
public db connection api get db connection return db connection
gets a database connection
public boolean is in transaction return db transaction null false true
checks if the database query is used explicitly within a transaction
public collection get collection throws db exception return get collection 0
gets a collection of all db query records
public collection get collection int begin throws db exception return get collection begin 1
gets a collection of db query records starting with the begin position
public collection get collection int begin int max size throws db exception select all collection results fill collection begin max size release return results
gets a collection of db query records starting with the begin position and
public boolean contains map primary key throws db exception boolean outcome false try db query record api record retrieve primary key if record null outcome true catch db exception e db raise db exception e get message db query contains db query contains return outcome
checks if this database query contains a db query record with the given
protected collection fill collection int begin int max size throws db exception collection results new array list if begin 0 for int i 0 i begin i next int count 0 while next db query record api current record current record results add current record count if max size 0 count max size break return results
fills a collection with a block of db query records
protected void release throws db exception if is in transaction db connection close opened false
if a database query is not used explicitly within a transaction it is
public void result set string db query string throws db exception try sql command db query string pripremi komandu u prepare statement sql query izvrsenje upita i kreiranje result set a po imenu result set this has next true catch db exception e log error db exception e catch exception e log error exception e return null
gets an iterator over db query records
public boolean next throws db exception try if opened if result set next this has next true return true this has next false return false else this has next false return false catch sqlexception e log error problem with next db raise db exception e get message sql query next sql query next return false
finds the next sql database query record if it exists
private string get sqlwhere for db criteria db criteria api selection criteria string sql if selection criteria instanceof db criteria group db criteria group criteria group db criteria group selection criteria sql get sqlwhere for db criteria group criteria group else if selection criteria instanceof db simple criteria db simple criteria simple criteria db simple criteria selection criteria sql get sqlwhere for db simple criteria simple criteria return sql
gets an sql statement where expression based on a database selection
protected void release throws db exception exception e null if opened try if result set null result set close prepared statement close catch sqlexception sqle e sqle finally opened false super release if e null log error sql db query not closed db raise db exception e get message sql query close sql query close
releases the sql database query
public void sql command string sql throws db exception try if opened if db connection null db is opened connection db connection db get db connection prepared statement db get db connection prepare statement sql opened true catch sqlexception e log error sql db query not opened db raise db exception e get message query open query open
prepares an sql command for a closed sql database query
public void sql cleanup throws db exception try if opened prepared statement clear parameters catch sqlexception e log error sql db query sql cleanup problem db raise db exception e get message query sql cleanup query sql cleanup
clears sql command parameters
public void sql query throws db exception try if opened result set prepared statement execute query catch sqlexception e log error sql db query sql query problem db raise db exception e get message sql query sql query sql query sql query
executes an sql select command
public int sql update throws db exception int updated rows count 1 try if opened updated rows count prepared statement execute update catch sqlexception e log error sql db query sql update problem db raise db exception e get message sql query sql update sql query sql update return updated rows count
executes an sql update command
protected int get row count throws db exception try if result set next return result set get int 1 based on select count from table name else return 1 catch sqlexception e log error no row count db raise db exception e get message sql query get row count sql query get row count return 1
gets a row count
public string get column string string column name throws db exception try return result set get string column name catch sqlexception e log error no column string db raise db exception e get message sql query get column string sql query get column string return
gets a column string based on the column name for the current row
public integer get column integer string column name throws db exception try string col value result set get string column name return col value null new integer col value null catch sqlexception e log error no column integer db raise db exception e get message sql query get column integer sql query get column integer return null
gets a column integer based on the column name for the current row
private string get sqlorder by db simple criteria order by criterias string sql if order by criterias null order by criterias length 0 sql order by for int i 0 i order by criterias length i db simple criteria order by criteria order by criterias i sql order by criteria get property name boolean ascending boolean order by criteria get value boolean value if ascending sql asc else sql desc if i order by criterias length 1 sql return sql
gets sql order by
public double get column double string column name throws db exception try string col value result set get string column name return col value null new double col value null catch sqlexception e log error no column double db raise db exception e get message sql query get column double sql query get column double return null
gets a column double based on the column name for the current row
public long get column long string column name throws db exception try string col value result set get string column name return col value null new long col value null catch sqlexception e log error no column long db raise db exception e get message sql query get column long sql query get column long return null
gets a column long based on the column name for the current row
public void set path string path this path path init variables path
sets a db configuration file path
public float get column float string column name throws db exception try string col value result set get string column name return col value null new float col value null catch sqlexception e log error no column float db raise db exception e get message sql query get column float sql query get column float return null
gets a column float based on the column name for the current row
public void set dbms string dbms this dbms dbms
sets a database managament system name
public short get column short string column name throws db exception try string col value result set get string column name return col value null new short col value null catch sqlexception e log error no column short db raise db exception e get message sql query get column short sql query get column short return null
gets a column short based on the column name for the current row
public boolean get column boolean string column name throws db exception try string col value result set get string column name if col value null if col value equals 1 col value equals true return new boolean true else if col value equals 0 col value equals false return new boolean false return null catch sqlexception e log error no column boolean db raise db exception e get message sql query get column boolean sql query get column boolean return null
gets a column boolean based on the column name for the current row
public date get column date string column name throws db exception try return result set get date column name catch sqlexception e log error no column date db raise db exception e get message sql query get column date sql query get column date return null
gets a column date based on the column name for the current row
public time get column time string column name throws db exception try return result set get time column name catch sqlexception e log error no column time db raise db exception e get message sql query get column time sql query get column time return null
gets a column time based on the column name for the current row
public int get db connections min count return db connections min count
gets a database connections min count
public timestamp get column timestamp string column name throws db exception try return result set get timestamp column name catch sqlexception e log error no column timestamp db raise db exception e get message sql query get column timestamp sql query get column timestamp return null
gets a column timestamp based on the column name for the current row
public void set db connections min count string db connections min count as string set db connections min count integer parse int db connections min count as string
sets a database connections min count
public object get column object string column name throws db exception try return result set get object column name catch sqlexception e log error no column object db raise db exception e get message sql query get column object sql query get column string return null
gets a column object based on the column name for the current row
public void set db connections max count string db connections max count as string set db connections max count integer parse int db connections max count as string
sets a database connections max count
private object execute get property method ientity entity string property code object property value null try property value reflector get field entity property code catch exception e log error error in model meta execute get property method e get message return property value
executes the entity get property method