openlsd.newbusiness
Class LSDBusinessImpl

java.lang.Object
  extended by openlsd.database.business.LSDBusiness
      extended by openlsd.newbusiness.LSDBusinessImpl

public class LSDBusinessImpl
extends LSDBusiness

This class contains all Business data and database relative functions

Author:
Frederic BREGIER LGPL 2007

Field Summary
static java.lang.String allFieldsExt
          Must Be Extended in Implementation:
Values to add to allfields (replace select *)
protected static java.lang.String[] fieldsext
          Must Be Extended in Implementation:
Extended fields for Business
static java.lang.String getFieldsSetAllExt
          Must Be Extended in Implementation:
Set for all fields
static java.lang.String getFieldsSetExt
          Must Be Extended in Implementation:
Set for all fields except fields used in getWhereClause
static java.lang.String getFieldsSetExtNULL
          Must Be Extended in Implementation:
Set values as NULL (or empty) including where clause
static java.lang.String getWhereClause
          Must Be Extended in Implementation:
Where condition in " condition " format which will be added to " WHERE Legacy = ?
 java.lang.String idb
          Must Be Extended in Implementation:
Business index
 long idbunit
          Must Be Extended in Implementation:
Business Unit
 java.lang.String idowner
          Must Be Extended in Implementation:
Business Owner
 java.sql.Timestamp limitdate
          Must Be Extended in Implementation:
Limit of time validity
static int ridb
          Must Be Extended in Implementation:
Index for extended fields for Business
static int ridbunit
          Must Be Extended in Implementation:
Index for extended fields for Business
static int ridowner
          Index for extended fields for Business
static int rlimitdate
          Index for extended fields for Business
 
Constructor Summary
LSDBusinessImpl()
          Default empty constructor
LSDBusinessImpl(int[] ranks, java.lang.String[] args)
          Constructor from 1 int[] for rank and 1 String[] for value
LSDBusinessImpl(LSDBusiness lsdb)
          Constructor from data
LSDBusinessImpl(LSDBusinessImpl lsdb)
          Constructor from data
 
Method Summary
 void clear()
          Clear all data in the object
 LSDBusiness clone()
          Clone the current object but only copy values
 java.lang.String doc_hintBusiness()
          Returns the hint for DOC on Business Index (SELECT "hint" 1 FROM LSDDOCUMENT WHERE getWhereClauseBusiness)
 boolean equals(LSDBusiness other)
          Comparison of two LSDBusiness object on primary key (Business Index)
 boolean equals(LSDBusinessImpl other)
          Comparison of two LSDBusinessImpl object on primary key (Business Index)
 java.lang.String getAllFieldsExt()
          Values to add to allfields (replace select *)
 java.lang.String getFieldsExt(int number)
          Extended fields for Business
 java.lang.String getFieldsSetAllExt()
          Set for all fields
 java.lang.String getFieldsSetExt()
          Set for all fields except fields used in getWhereClause
 java.lang.String getFieldsSetExtNULL()
          Set values as NULL (or empty) including where clause
 java.lang.String getFieldsValues()
          Set Values for Insert command
 boolean getFromResultSet(java.sql.ResultSet resultSet)
          Set internal value from ResultSet
 java.lang.String getWhereClause()
          Where condition in " condition " format which will be added to " WHERE Legacy = ?
 boolean setFromLSDBusiness(LSDBusiness lsdb)
          Set the currect object to the values from the object as parameter
 boolean setFromLSDBusiness(LSDBusinessImpl lsdb)
           
 void setFromString(java.lang.String line)
          (non-Javadoc)
 boolean setFromStringArray(int[] ranks, java.lang.String[] args)
          Set from 1 int[] for rank and 1 String[] for value
 int setFromStrings(int curargs, java.lang.String[] args)
          (non-Javadoc)
 int setToPrepStmtGetFieldsSetAllExt(int startrank, LSDDbPreparedStatement preparedStatement)
          Set the value into the prepareStatement from Object for the set in GetFieldsSetAllExt
 int setToPrepStmtGetFieldsSetExt(int startrank, LSDDbPreparedStatement preparedStatement)
          Set the value into the prepareStatement from Object for the set in GetFieldsSetExt
 int setToPrepStmtGetWhereClause(int startrank, LSDDbPreparedStatement preparedStatement)
          Set the value into the prepareStatement from Object for the Where Condition in getWhereClause
 java.lang.String toCSV()
          (non-Javadoc)
 java.lang.String toString()
          Object to String
 
Methods inherited from class openlsd.database.business.LSDBusiness
newBusiness
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

idb

public java.lang.String idb
Must Be Extended in Implementation:
Business index


idbunit

public long idbunit
Must Be Extended in Implementation:
Business Unit


idowner

public java.lang.String idowner
Must Be Extended in Implementation:
Business Owner


limitdate

public java.sql.Timestamp limitdate
Must Be Extended in Implementation:
Limit of time validity


fieldsext

protected static final java.lang.String[] fieldsext
Must Be Extended in Implementation:
Extended fields for Business


ridb

public static final int ridb
Must Be Extended in Implementation:
Index for extended fields for Business

See Also:
Constant Field Values

ridbunit

public static final int ridbunit
Must Be Extended in Implementation:
Index for extended fields for Business

See Also:
Constant Field Values

ridowner

public static final int ridowner
Index for extended fields for Business

See Also:
Constant Field Values

rlimitdate

public static final int rlimitdate
Index for extended fields for Business

See Also:
Constant Field Values

allFieldsExt

public static final java.lang.String allFieldsExt
Must Be Extended in Implementation:
Values to add to allfields (replace select *)


getWhereClause

public static java.lang.String getWhereClause
Must Be Extended in Implementation:
Where condition in " condition " format which will be added to " WHERE Legacy = ? AND condition " and that must returns 1 unique document.


getFieldsSetExt

public static java.lang.String getFieldsSetExt
Must Be Extended in Implementation:
Set for all fields except fields used in getWhereClause


getFieldsSetAllExt

public static java.lang.String getFieldsSetAllExt
Must Be Extended in Implementation:
Set for all fields


getFieldsSetExtNULL

public static java.lang.String getFieldsSetExtNULL
Must Be Extended in Implementation:
Set values as NULL (or empty) including where clause

Constructor Detail

LSDBusinessImpl

public LSDBusinessImpl()
Default empty constructor


LSDBusinessImpl

public LSDBusinessImpl(LSDBusiness lsdb)
Constructor from data

Parameters:
lsdb -

LSDBusinessImpl

public LSDBusinessImpl(int[] ranks,
                       java.lang.String[] args)
Constructor from 1 int[] for rank and 1 String[] for value

Parameters:
ranks -
args -

LSDBusinessImpl

public LSDBusinessImpl(LSDBusinessImpl lsdb)
Constructor from data

Parameters:
lsdb -
Method Detail

getAllFieldsExt

public java.lang.String getAllFieldsExt()
Description copied from class: LSDBusiness
Values to add to allfields (replace select *)

Specified by:
getAllFieldsExt in class LSDBusiness
Returns:
Values to add to allfields (replace select *)
See Also:
LSDBusiness.getAllFieldsExt()

getFieldsExt

public java.lang.String getFieldsExt(int number)
Description copied from class: LSDBusiness
Extended fields for Business

Specified by:
getFieldsExt in class LSDBusiness
Returns:
The Extended fields for Business
See Also:
LSDBusiness.getFieldsExt(int)

getFieldsSetAllExt

public java.lang.String getFieldsSetAllExt()
Description copied from class: LSDBusiness
Set for all fields

Specified by:
getFieldsSetAllExt in class LSDBusiness
Returns:
Set for all fields
See Also:
LSDBusiness.getFieldsSetAllExt()

getFieldsSetExt

public java.lang.String getFieldsSetExt()
Description copied from class: LSDBusiness
Set for all fields except fields used in getWhereClause

Specified by:
getFieldsSetExt in class LSDBusiness
Returns:
Set for all fields except fields used in getWhereClause
See Also:
LSDBusiness.getFieldsSetExt()

getFieldsSetExtNULL

public java.lang.String getFieldsSetExtNULL()
Description copied from class: LSDBusiness
Set values as NULL (or empty) including where clause

Specified by:
getFieldsSetExtNULL in class LSDBusiness
Returns:
Set values as NULL (or empty) including where clause
See Also:
LSDBusiness.getFieldsSetExtNULL()

getWhereClause

public java.lang.String getWhereClause()
Description copied from class: LSDBusiness
Where condition in " condition " format which will be added to " WHERE Legacy = ? AND condition " and that must returns 1 unique document.

Specified by:
getWhereClause in class LSDBusiness
Returns:
Where condition
See Also:
LSDBusiness.getWhereClause()

doc_hintBusiness

public java.lang.String doc_hintBusiness()
Returns the hint for DOC on Business Index (SELECT "hint" 1 FROM LSDDOCUMENT WHERE getWhereClauseBusiness)

Specified by:
doc_hintBusiness in class LSDBusiness
Returns:
the String containing the hint to set after SELECT command based on getWhereClauseBusiness

setFromStringArray

public boolean setFromStringArray(int[] ranks,
                                  java.lang.String[] args)
Set from 1 int[] for rank and 1 String[] for value

Specified by:
setFromStringArray in class LSDBusiness
Parameters:
ranks -
args -
Returns:
True if OK, else False

equals

public boolean equals(LSDBusiness other)
Description copied from class: LSDBusiness
Comparison of two LSDBusiness object on primary key (Business Index)

Specified by:
equals in class LSDBusiness
Returns:
True if Business index are the same, else False
See Also:
LSDBusiness.equals(openlsd.database.business.LSDBusiness)

setFromLSDBusiness

public boolean setFromLSDBusiness(LSDBusiness lsdb)
Description copied from class: LSDBusiness
Set the currect object to the values from the object as parameter

Specified by:
setFromLSDBusiness in class LSDBusiness
Returns:
True if OK, else False
See Also:
LSDBusiness.setFromLSDBusiness(openlsd.database.business.LSDBusiness)

getFromResultSet

public boolean getFromResultSet(java.sql.ResultSet resultSet)
Set internal value from ResultSet

Specified by:
getFromResultSet in class LSDBusiness
Parameters:
resultSet -
Returns:
True if OK, else False

getFieldsValues

public java.lang.String getFieldsValues()
Set Values for Insert command

Specified by:
getFieldsValues in class LSDBusiness
Returns:
the String for Insert command Value part

setToPrepStmtGetWhereClause

public int setToPrepStmtGetWhereClause(int startrank,
                                       LSDDbPreparedStatement preparedStatement)
Set the value into the prepareStatement from Object for the Where Condition in getWhereClause

Specified by:
setToPrepStmtGetWhereClause in class LSDBusiness
Parameters:
startrank - The value to start from in the preparedStatement.setXXX call
preparedStatement -
Returns:
the next startrank or 0 if KO

setToPrepStmtGetFieldsSetExt

public int setToPrepStmtGetFieldsSetExt(int startrank,
                                        LSDDbPreparedStatement preparedStatement)
Set the value into the prepareStatement from Object for the set in GetFieldsSetExt

Specified by:
setToPrepStmtGetFieldsSetExt in class LSDBusiness
Parameters:
startrank - The value to start from in the preparedStatement.setXXX call
preparedStatement -
Returns:
the next startrank or 0 if KO

setToPrepStmtGetFieldsSetAllExt

public int setToPrepStmtGetFieldsSetAllExt(int startrank,
                                           LSDDbPreparedStatement preparedStatement)
Set the value into the prepareStatement from Object for the set in GetFieldsSetAllExt

Specified by:
setToPrepStmtGetFieldsSetAllExt in class LSDBusiness
Parameters:
startrank - The value to start from in the preparedStatement.setXXX call
preparedStatement -
Returns:
the next startrank or 0 if KO

clear

public void clear()
Clear all data in the object

Specified by:
clear in class LSDBusiness

clone

public LSDBusiness clone()
Clone the current object but only copy values

Specified by:
clone in class LSDBusiness
Returns:
The new object as a clone

setFromLSDBusiness

public boolean setFromLSDBusiness(LSDBusinessImpl lsdb)
Parameters:
lsdb -
Returns:
True if OK, else False
See Also:
LSDBusiness.setFromLSDBusiness(openlsd.database.business.LSDBusiness)

equals

public boolean equals(LSDBusinessImpl other)
Comparison of two LSDBusinessImpl object on primary key (Business Index)

Parameters:
other -
Returns:
True if Business index are the same, else False

toString

public java.lang.String toString()
Object to String

Specified by:
toString in class LSDBusiness
Returns:
the string that displays this object
See Also:
Object.toString()

setFromString

public void setFromString(java.lang.String line)
(non-Javadoc)

Specified by:
setFromString in class LSDBusiness
See Also:
LSDBusiness.setFromString(java.lang.String)

setFromStrings

public int setFromStrings(int curargs,
                          java.lang.String[] args)
(non-Javadoc)

Specified by:
setFromStrings in class LSDBusiness
Returns:
The next args rank to read
See Also:
LSDBusiness.setFromStrings(int, java.lang.String[])

toCSV

public java.lang.String toCSV()
(non-Javadoc)

Specified by:
toCSV in class LSDBusiness
Returns:
the string that displays this object as CSV
See Also:
LSDBusiness.toCSV()