|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.mathema.pride.DatabaseAdapter de.mathema.pride.ObjectAdapter
public abstract class ObjectAdapter
Convenience baseclass, providing a set of ready-to-use standard methods for interaction between the database and data entity objects. This is a derivation from DatabaseAdapter assuming that derived types provide functions to access the type's record descriptor, primary key definition and operation value object
Field Summary | |
---|---|
static java.lang.String |
REVISION_ID
|
Constructor Summary | |
---|---|
ObjectAdapter()
|
Method Summary | |
---|---|
void |
commit()
|
java.lang.String |
constraint()
Returns a constraint made up from the primary key attributes of this getEntity() |
java.lang.String |
constraint(java.lang.String[] dbfields)
|
java.lang.String |
constraint(java.lang.String[] dbfields,
boolean byLike)
|
int |
create()
|
int |
create(java.lang.String[] autoFields)
|
void |
createx()
|
int |
delete()
|
int |
delete(java.lang.String[] dbkeyfields)
|
void |
fetch(java.lang.Object key)
Fetch an object by key. |
void |
fetchx()
|
void |
fetchx(java.lang.String attrName)
|
void |
fetchx(java.lang.String[] attrNames)
|
void |
find()
Same like query() but takes the first record only |
void |
find(java.lang.String where)
Same like query() but takes the first record only |
void |
find(java.lang.String[] dbfields)
Same like query() but takes the first record only |
java.lang.String[] |
getAutoFields()
Returns a list of fields being managed automatically by the database and therefore must not be passed in a record creation. |
protected static Database |
getDatabase(ExtensionDescriptor xd)
|
protected static Database |
getDatabase(RecordDescriptor red)
|
protected abstract RecordDescriptor |
getDescriptor()
Returns the entity's record desriptor. |
protected abstract java.lang.Object |
getEntity()
Returns the value object the adapter is operating on |
java.lang.String[] |
getKeyFields()
Returns the primary key fields for this entity. |
protected ExtensionDescriptor |
getXDescriptor()
Returns the attribute extension descriptor for this entity. |
void |
process(java.lang.Exception x)
|
ResultIterator |
query(java.lang.String where)
Fetch an object by a self-made where clause |
ResultIterator |
query(java.lang.String[] dbfields)
Fetch an object by fields. |
ResultIterator |
queryAll()
Fetch all objects |
int |
update()
|
int |
update(java.lang.String where)
|
int |
update(java.lang.String[] dbkeyfields)
|
int |
update(java.lang.String[] dbkeyfields,
java.lang.String[] updatefields)
|
int |
update(java.lang.String where,
java.lang.String[] updatefields)
|
void |
updatex()
|
void |
updatex(java.lang.String attrName)
|
void |
updatex(java.lang.String[] attrNames)
|
ResultIterator |
wildcard(java.lang.String[] dbfields)
Same like query() but performs a wildcard search |
Methods inherited from class de.mathema.pride.DatabaseAdapter |
---|
commit, constraint, create, create, create, delete, delete, fetch, fetch, fetch, fetch, find, find, find, process, query, query, queryAll, update, update, update, update, update, update, update, update, wildcard |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String REVISION_ID
Constructor Detail |
---|
public ObjectAdapter()
Method Detail |
---|
protected abstract RecordDescriptor getDescriptor()
public java.lang.String[] getKeyFields()
null
by default causing the update()
and delete()
functions below to use the first field in
the record descriptor as primary key.
public java.lang.String[] getAutoFields()
null
by default causing all fields of the record
descriptor to be considered.
protected ExtensionDescriptor getXDescriptor()
null
by default, causing the
extension access functions to fail. So be shure to override this
function if you're using extended attributes.
protected abstract java.lang.Object getEntity()
protected static Database getDatabase(RecordDescriptor red)
protected static Database getDatabase(ExtensionDescriptor xd)
public void fetch(java.lang.Object key) throws java.sql.SQLException
java.sql.SQLException
public ResultIterator query(java.lang.String[] dbfields) throws java.sql.SQLException
java.sql.SQLException
public ResultIterator wildcard(java.lang.String[] dbfields) throws java.sql.SQLException
query()
but performs a wildcard search
java.sql.SQLException
public void find(java.lang.String[] dbfields) throws java.sql.SQLException
query()
but takes the first record only
java.sql.SQLException
public void find() throws java.sql.SQLException
query()
but takes the first record only
java.sql.SQLException
public ResultIterator queryAll() throws java.sql.SQLException
java.sql.SQLException
public ResultIterator query(java.lang.String where) throws java.sql.SQLException
java.sql.SQLException
public void find(java.lang.String where) throws java.sql.SQLException
query()
but takes the first record only
java.sql.SQLException
public int update() throws java.sql.SQLException
java.sql.SQLException
public int update(java.lang.String[] dbkeyfields) throws java.sql.SQLException
java.sql.SQLException
public int update(java.lang.String[] dbkeyfields, java.lang.String[] updatefields) throws java.sql.SQLException
java.sql.SQLException
public int update(java.lang.String where) throws java.sql.SQLException
java.sql.SQLException
public int update(java.lang.String where, java.lang.String[] updatefields) throws java.sql.SQLException
java.sql.SQLException
public int create() throws java.sql.SQLException
java.sql.SQLException
public int create(java.lang.String[] autoFields) throws java.sql.SQLException
java.sql.SQLException
public int delete() throws java.sql.SQLException
java.sql.SQLException
public int delete(java.lang.String[] dbkeyfields) throws java.sql.SQLException
java.sql.SQLException
public java.lang.String constraint(java.lang.String[] dbfields, boolean byLike)
public java.lang.String constraint(java.lang.String[] dbfields)
public java.lang.String constraint()
public void commit() throws java.sql.SQLException
java.sql.SQLException
public void process(java.lang.Exception x) throws java.sql.SQLException
java.sql.SQLException
public void updatex() throws java.sql.SQLException
java.sql.SQLException
public void updatex(java.lang.String attrName) throws java.sql.SQLException
java.sql.SQLException
public void updatex(java.lang.String[] attrNames) throws java.sql.SQLException
java.sql.SQLException
public void fetchx() throws java.sql.SQLException
java.sql.SQLException
public void fetchx(java.lang.String attrName) throws java.sql.SQLException
java.sql.SQLException
public void fetchx(java.lang.String[] attrNames) throws java.sql.SQLException
java.sql.SQLException
public void createx() throws java.sql.SQLException
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |