API Overview API Index Package Overview Direct link to this page
JavaOnTracks 0.1.2
  net.jot.persistance. JOTModel View Source
Author(s)
Thibaut Colar http://jot.colar.net/ TODO: support/use transactionnal db queries TODO: support join ? TODO: if field is transient or starts with __ then ignore as a data field TODO: hasOne hasMany belongTo etc ... ?
Since
Version
Serial
Hierarchy
 Object
      JOTModelAddons
          JOTModel
Implements
Subclasses
Description
publicabstract 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.
See also:   
Constructors
public JOTModel ()
Methods
Hide/Show inherited methods
protectedstatic void createTableIfNecessary (JOTTransaction transaction, Class modelClass) throws Exception [Inherited From net.jot.persistance.JOTModelAddons]
Creates the table in the DB, if it doesn't exists yet
protectedabstract void customize (JOTModelMapping mapping)
  Implements the customization (User defined tables modifications, ie: fields mappings, etc ...)
public String defineStorage ()
  Returns the "storage" to be used by this Model.
public void delete () throws Exception
public void delete (JOTTransaction transaction) throws Exception
Deletes the coresponding record from the database
publicstatic void deleteWholeTable (JOTTransaction transaction, Class modelClass) throws Exception [Inherited From net.jot.persistance.JOTModelAddons]
  Dump a whole table (model) data into a stream(ie file) in CSV format
public Object getFieldValue (String fieldName)
public Object getFieldValues (JOTModelMapping mapping, JOTSQLCondition conds)
  Return all fields values
public long getId ()
publicfinal JOTModelMapping getMapping (JOTTransaction transaction) throws Exception
  Called to get the table mapping.
public Class getQueryImplClass ()
public void initQueryImplClass () throws Exception
Deletes the table in the DB
public boolean isNew ()
public void save () throws Exception
public void save (JOTTransaction transaction) throws Exception
Save/update the table in teh database.
publicfinal void setId (int id)
Fields
Hide/Show inherited fields
publicfinalstatictransient String DEFAULT_STORAGE = "default"
protected long id
The "id" of the object in the database (ie: primary key)
protectedtransient Class queryImplClass
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.5     ©Thibaut Colar