openlsm.lsmbusiness
Class LSDBusinessImpl

java.lang.Object
  extended by openlsd.database.business.LSDBusiness
      extended by openlsm.lsmbusiness.LSDBusinessImpl

public class LSDBusinessImpl
extends LSDBusiness

This class contains all Business data and database relative functions for OpenLSM.

Author:
Frederic BREGIER LGPL 2007

Field Summary
static java.lang.String allFieldsExt
          Values to add to allfields (replace select *)
 java.lang.String emaccount
          Email Account
static java.lang.String[] fieldsext
          Extended fields for Business
static java.lang.String getFieldsSetAllExt
          Set for all fields
static java.lang.String getFieldsSetExt
          Set for all fields except fields used in getWhereClause
static java.lang.String getFieldsSetExtNULL
          Set values as NULL (or empty) including where clause
static java.lang.String getWhereClause
          Where condition in " condition " format which will be added to " WHERE Legacy = ?
 java.lang.String idb
          Business index : day-hour-sender-email_account-random
 java.lang.String idowner
          Mail Owner
 java.sql.Timestamp maildate
          Date of mail
 java.lang.String recipients
          Recipients (from, to, cc, email account)
static int remaccount
          Index for extended fields for Business
static int ridb
          Index for extended fields for Business
static int ridowner
          Index for extended fields for Business
static int rmaildate
          Index for extended fields for Business
static int rrecipients
          Index for extended fields for Business
static int rsender
          Index for extended fields for Business
static int rsubject
          Index for extended fields for Business
 java.lang.String sender
          Sender
 java.lang.String subject
          Subject and Keyword and Domain
 
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()
          Object to CSV.
 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
Business index : day-hour-sender-email_account-random


sender

public java.lang.String sender
Sender


recipients

public java.lang.String recipients
Recipients (from, to, cc, email account)


subject

public java.lang.String subject
Subject and Keyword and Domain


emaccount

public java.lang.String emaccount
Email Account


idowner

public java.lang.String idowner
Mail Owner


maildate

public java.sql.Timestamp maildate
Date of mail


fieldsext

public static final java.lang.String[] fieldsext
Extended fields for Business


ridb

public static final int ridb
Index for extended fields for Business

See Also:
Constant Field Values

rsender

public static final int rsender
Index for extended fields for Business

See Also:
Constant Field Values

rrecipients

public static final int rrecipients
Index for extended fields for Business

See Also:
Constant Field Values

rsubject

public static final int rsubject
Index for extended fields for Business

See Also:
Constant Field Values

remaccount

public static final int remaccount
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

rmaildate

public static final int rmaildate
Index for extended fields for Business

See Also:
Constant Field Values

allFieldsExt

public static final java.lang.String allFieldsExt
Values to add to allfields (replace select *)


getWhereClause

public static java.lang.String getWhereClause
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
Set for all fields except fields used in getWhereClause


getFieldsSetAllExt

public static java.lang.String getFieldsSetAllExt
Set for all fields


getFieldsSetExtNULL

public static java.lang.String getFieldsSetExtNULL
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()
Description copied from class: LSDBusiness
Object to CSV. This method is intend for helping the database replication in case of ML support, so it should export all information of the Document in order to allow the corresponding insert or delete operation on duplicated database.

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