Simple Article class is not derived from any base class nor does it implement any Interface,
but still it can be made persistent by the PersistenceBroker.
Has a lot of private members to be mapped to rdbms columns, but only few business methods
Constructor Summary
public
Article(int pArticleId, String pArticleName, int pSupplierId, int pProcuctGroupId, String pUnit, double pPrice, int pStock, int pOrderedUnits, int pMinimumStock, boolean pIsSelloutArticle)
addToStock(int diff) increase the amount of articles in stock by diff
mark the object as modified only if value changes (i.e.
public void
afterAbort() afterAbort will be called after a transaction has been aborted.
The values of fields which get persisted will have changed to
what they were at the begining of the transaction.
public void
afterCommit() afterCommit is called only after a successful commit has taken
place.
public void
beforeAbort() beforeAbort is called before a transaction is aborted.
public void
beforeCommit() beforeCommit will give an object a chance to kill a
transaction before it is committed.
public Article(int pArticleId, String pArticleName, int pSupplierId, int pProcuctGroupId, String pUnit, double pPrice, int pStock, int pOrderedUnits, int pMinimumStock, boolean pIsSelloutArticle)(Code)
afterAbort will be called after a transaction has been aborted.
The values of fields which get persisted will have changed to
what they were at the begining of the transaction. This method
should be overridden to reset any transient or non-persistent
fields.
beforeCommit will give an object a chance to kill a
transaction before it is committed.
To kill a transaction, throw a new TransactionAbortedException.