public abstract class BaseMB
extends java.lang.Object
Constructor and Description |
---|
BaseMB()
If clbrowser is null, initializes it as new CLGuiomBrowser.
|
BaseMB(CLBrowser clbrowser,
java.lang.String classname)
Sets the clbrowser and does the initializations:
Initializes logger, instance, and if there is a FacesContext, request and session.
|
Modifier and Type | Method and Description |
---|---|
void |
delete(boolean soft)
Deletes this instance from the database
|
java.lang.Object |
get(java.lang.String key)
Returns the value for an attribute of this object's instance
|
long |
getId() |
Instance |
getInstance() |
java.lang.String |
getName() |
void |
load(JSONObject obj)
Loads from the given JSON to this object
for the class given by getClassname(), each property is read and copied from the json obj.
|
void |
load(long oid)
Loads the instance from database into this object, uses the classname associated to the object
which is implemented by the abstract getClassname().
|
void |
load(java.lang.String name)
Loads from the database to this object, the record given by "name"
for the class given by getClassname()
|
void |
logout() |
static void |
main(java.lang.String[] args) |
void |
save()
Saves this object to database.
|
void |
set(java.lang.String key,
java.lang.Object value)
Sets the value for the given attribute
|
void |
setInstance(Instance inst) |
public BaseMB() throws java.lang.Exception
java.lang.Exception
public BaseMB(CLBrowser clbrowser, java.lang.String classname) throws java.lang.Exception
java.lang.Exception
public Instance getInstance()
public void setInstance(Instance inst)
public void logout()
public void load(long oid) throws java.rmi.RemoteException, java.sql.SQLException, DataException
oid
- is the primary key of the instancejava.rmi.RemoteException
java.sql.SQLException
DataException
public void load(java.lang.String name) throws java.rmi.RemoteException, java.sql.SQLException, DataException
name
- java.rmi.RemoteException
java.sql.SQLException
DataException
public void load(JSONObject obj) throws java.lang.Exception
obj
- is the JSON representation of the objectjava.rmi.RemoteException
java.sql.SQLException
DataException
java.lang.Exception
public long getId()
public java.lang.String getName()
public void save() throws QuerySaveException, java.rmi.RemoteException, java.sql.SQLException, DataException
QuerySaveException
java.rmi.RemoteException
java.sql.SQLException
DataException
public java.lang.Object get(java.lang.String key)
key
- the name of the attributepublic void set(java.lang.String key, java.lang.Object value)
key
- name of the attributevalue
- public static void main(java.lang.String[] args)
args
- public void delete(boolean soft) throws java.rmi.RemoteException, java.sql.SQLException, DataException
soft
- will flag the record as deleted, without actually deleting itjava.rmi.RemoteException
java.sql.SQLException
DataException