Class SaleDM
data_management
server.Database
  data_management.SaleDM
All Implemented Interfaces:
IDM

public class SaleDM
extends Database
implements IDM
Author:
TogetherSoft
robustness:
Entity
subtitle:
(The database)
See Also:  Node Documentation

Field Summary
private static final String[]
NumberFormat
SimpleDateFormat
static final String[]
NumberFormat
static final String[]
Constructor Summary
SaleDM(DMServer dmServer)
Constructor must be passed the Server instance.
Method Summary
Vector
getAll()
This retrieves all of the cash sales in the database :=)
Object
Vector
getList()
This represents the "shallow retrieve."
void
insert(Object obj)
I'd prefer it if this was protected...
private String
removeIllegalChars(String string)
Helper function to strip chars from currency input widget.
void
save(Object obj)
void
update(Object obj)
I'd prefer it if this was protected, but it is part of the interface...
Methods inherited from class server.Database
getData
Methods inherited from interface problem_domain.IDM
getAll, getData, getList, insert, save, update
Field Detail
columnNames
private static final String[] columnNames = new String[] { "ID", "SaleTime", "Subtotal", "Tax" }

insertableColumns
static final String[] insertableColumns = new String[] { "ID", "SaleTime", "Subtotal", "Tax" }

updatableColumns
static final String[] updatableColumns = new String[] { "SaleTime", "Subtotal", "Tax" }

dmServer
DMServer dmServer = null

dateFormat
SimpleDateFormat dateFormat = null

currencyFormat
NumberFormat currencyFormat = NumberFormat.getCurrencyInstance()

numberFormat
NumberFormat numberFormat
Constructor Detail
SaleDM
public SaleDM(DMServer dmServer)
Constructor must be passed the Server instance.
Method Detail
insert
public void insert(Object obj)
            throws SQLException
I'd prefer it if this was protected...
Specified by:
insert in interface IDM

update
public void update(Object obj)
            throws SQLException
I'd prefer it if this was protected, but it is part of the interface...
Specified by:
update in interface IDM

getList
public Vector getList()
               throws SQLException
This represents the "shallow retrieve." That is, the ability to return just the ID and Name of an object. Useful for browsing, or for pick lists. (A technique to avoid a deep retrieve of all objects, fully-formed, which could be quite expensive in terms of performance and using potentially scarce DBMS resources.)
Specified by:
getList in interface IDM

getAll
public Vector getAll()
              throws SQLException
This retrieves all of the cash sales in the database :=)
note:
someday, we'll add some date "range" clauses.
Specified by:
getAll in interface IDM

save
public void save(Object obj)
          throws SQLException
Specified by:
save in interface IDM

getData
public Object getData(CustResultSet rs)
               throws SQLException
Specified by:
getData in interface IDM
Overrides:
getData in class Database

removeIllegalChars
private String removeIllegalChars(String string)
Helper function to strip chars from currency input widget.