|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.jot.persistance.JOTModel
public abstract class JOTModel
Generic Persistance model
Implementation for example include DB, filesystem etc ...
If the table doesn't exists yet, it will be created automatically.
Note that if you change your model (add fields, rename fields etc.. you will have to handle changes in the upgrade() method.
| Field Summary | |
|---|---|
protected long |
dataId
The "dataId" of the object in the database (ie: primary key) |
protected static java.lang.String |
DEFAULT_STORAGE
|
protected java.lang.Class |
queryImplClass
|
| Constructor Summary | |
|---|---|
JOTModel()
|
|
| Method Summary | |
|---|---|
protected void |
createTable(JOTModelMapping mapping)
Creates the table in the DB, if it doesn't exists yet |
abstract void |
customize(JOTModelMapping mapping)
Implements the customization (User defined tables modifications, ie: fields mappings, etc ...) |
abstract java.lang.String |
defineStorage()
Returns the "storage" to be used by this Model. |
void |
delete()
Deletes the coresponding record from the database |
protected void |
deleteTable()
Deletes the table in the DB |
java.lang.Object |
getFieldValue(java.lang.String fieldName)
|
java.lang.Object[] |
getFieldValues(JOTModelMapping mapping,
JOTSQLCondition[] conds)
Return the fields values |
long |
getId()
|
JOTModelMapping |
getMapping()
Called once by the QueryManager to get the table mapping. |
java.lang.Class |
getQueryImplClass()
|
void |
initQueryImplClass()
|
boolean |
isNew()
|
void |
save()
Save/update the table in teh database. |
void |
setId(int id)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected long dataId
protected java.lang.Class queryImplClass
protected static final java.lang.String DEFAULT_STORAGE
| Constructor Detail |
|---|
public JOTModel()
| Method Detail |
|---|
public final JOTModelMapping getMapping()
throws java.lang.Exception
java.lang.Exceptionpublic abstract void customize(JOTModelMapping mapping)
mapping - public abstract java.lang.String defineStorage()
storageName -
public java.lang.Object[] getFieldValues(JOTModelMapping mapping,
JOTSQLCondition[] conds)
mapping - conds -
public java.lang.Object getFieldValue(java.lang.String fieldName)
public long getId()
public void setId(int id)
public void delete()
throws java.lang.Exception
java.lang.Exception
public void save()
throws java.lang.Exception
java.lang.Exception
protected void createTable(JOTModelMapping mapping)
throws java.lang.Exception
java.lang.Exceptionpublic boolean isNew()
protected void deleteTable()
throws java.lang.Exception
java.lang.Exception
public void initQueryImplClass()
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.Class getQueryImplClass()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||