public final class ContactLoader extends java.lang.Object implements ImportLoader
Load Contact, Company and Address data from a single source
Contact loader creates or updates simultaneously registers at k_companies, k_contacts and k_addresses tables and the links between them k_x_contact_addr.Modifier and Type | Field and Description |
---|---|
static int |
ADD_TO_LIST |
static int |
ALLOW_DUPLICATED_PASSPORTS |
static int |
bo_active |
static int |
bo_change_pwd |
static int |
bo_private |
static int |
contact_person |
static int |
coord_x |
static int |
coord_y |
static int |
de_company |
static int |
de_title |
static int |
direct_phone |
static int |
dt_birth |
static int |
dt_created |
static int |
dt_drivelic |
static int |
dt_founded |
static int |
dt_modified |
static int |
dt_pwd_expires |
static int |
fax_phone |
static int |
gu_address |
static int |
gu_company |
static int |
gu_contact |
static int |
gu_geozone |
static int |
gu_list |
static int |
gu_sales_man |
static int |
gu_workarea |
static int |
gu_writer |
static int |
home_phone |
static int |
id_address_ref |
static int |
id_batch |
static int |
id_company_ref |
static int |
id_company_status |
static int |
id_contact_ref |
static int |
id_contact_status |
static int |
id_country |
static int |
id_gender |
static int |
id_legal |
static int |
id_nationality |
static int |
id_sector |
static int |
id_state |
static int |
im_revenue |
static int |
ix_address |
static int |
mn_city |
static int |
MODE_APPEND |
static int |
MODE_APPENDUPDATE |
static int |
MODE_UPDATE |
static int |
mov_phone |
static int |
nm_commercial |
static int |
nm_country |
static int |
nm_legal |
static int |
nm_state |
static int |
nm_street |
static int |
NO_DUPLICATED_MAILS |
static int |
NO_DUPLICATED_NAMES |
static int |
nu_employees |
static int |
nu_street |
static int |
ny_age |
static int |
other_phone |
static int |
po_box |
static int |
sn_drivelic |
static int |
sn_passport |
static int |
tp_company |
static int |
tp_location |
static int |
tp_passport |
static int |
tp_street |
static int |
tx_addr1 |
static int |
tx_addr2 |
static int |
tx_challenge |
static int |
tx_comments |
static int |
tx_dept |
static int |
tx_division |
static int |
tx_email |
static int |
tx_email_alt |
static int |
tx_franchise |
static int |
tx_name |
static int |
tx_nickname |
static int |
tx_pwd |
static int |
tx_remarks |
static int |
tx_reply |
static int |
tx_salutation |
static int |
tx_surname |
static int |
url_addr |
static int |
work_phone |
static int |
WRITE_ADDRESSES |
static int |
WRITE_COMPANIES |
static int |
WRITE_CONTACTS |
static int |
WRITE_LOOKUPS |
static int |
zipcode |
LOOUKP_TR_COLUMNS, LOOUKP_TR_COUNT
Constructor and Description |
---|
ContactLoader()
Default construtor
|
ContactLoader(java.sql.Connection oConn)
Create ContactLoader and call prepare() on Connection
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close prepared statements
This method must always be called before object is destroyed or else
|
int |
columnCount()
Get columns count
|
java.lang.String[] |
columnNames()
Get array of column names
|
java.lang.Object |
get(int iColumnIndex)
Get column by index
|
java.lang.Object |
get(java.lang.String sColumnName)
Get column by name
|
int |
getColumnIndex(java.lang.String sColumnName)
Get column index at ColumnNames array given its name
This method performs binary search assuming that ColumnNames is sorted in
ascending order
|
void |
prepare(java.sql.Connection oConn,
ColumnList oColList)
Prepare statements for execution
This method needs to be called only once if the default constructor was used.
|
void |
put(int iColumnIndex,
java.lang.Object oValue)
Put value for a given column
|
void |
put(java.lang.String sColumnName,
java.lang.Object oValue)
Put value for a given column
If a previous value already exists then it is replaced
|
void |
putAll(java.util.Map oValues)
Put all values from a map on their corresponding columns matching by name
|
void |
setAllColumnsToNull()
Set all column values to null
|
void |
store(java.sql.Connection oConn,
java.lang.String sWorkArea,
int iFlags)
Store properties curently held in RAM into the database
|
public static final int MODE_APPEND
public static final int MODE_UPDATE
public static final int MODE_APPENDUPDATE
public static final int WRITE_LOOKUPS
public static final int WRITE_COMPANIES
public static final int WRITE_CONTACTS
public static final int WRITE_ADDRESSES
public static final int NO_DUPLICATED_NAMES
public static final int NO_DUPLICATED_MAILS
public static final int ALLOW_DUPLICATED_PASSPORTS
public static final int ADD_TO_LIST
public static int bo_active
public static int bo_change_pwd
public static int bo_private
public static int contact_person
public static int coord_x
public static int coord_y
public static int de_company
public static int de_title
public static int direct_phone
public static int dt_birth
public static int dt_created
public static int dt_drivelic
public static int dt_founded
public static int dt_modified
public static int dt_pwd_expires
public static int fax_phone
public static int gu_address
public static int gu_company
public static int gu_contact
public static int gu_geozone
public static int gu_list
public static int gu_sales_man
public static int gu_workarea
public static int gu_writer
public static int home_phone
public static int id_address_ref
public static int id_batch
public static int id_company_ref
public static int id_company_status
public static int id_contact_ref
public static int id_contact_status
public static int id_country
public static int id_gender
public static int id_legal
public static int id_nationality
public static int id_sector
public static int id_state
public static int im_revenue
public static int ix_address
public static int mn_city
public static int mov_phone
public static int nm_commercial
public static int nm_country
public static int nm_legal
public static int nm_state
public static int nm_street
public static int nu_employees
public static int nu_street
public static int ny_age
public static int other_phone
public static int po_box
public static int sn_drivelic
public static int sn_passport
public static int tp_company
public static int tp_location
public static int tp_passport
public static int tp_street
public static int tx_addr1
public static int tx_addr2
public static int tx_challenge
public static int tx_comments
public static int tx_dept
public static int tx_division
public static int tx_email
public static int tx_email_alt
public static int tx_franchise
public static int tx_name
public static int tx_nickname
public static int tx_pwd
public static int tx_remarks
public static int tx_reply
public static int tx_salutation
public static int tx_surname
public static int url_addr
public static int work_phone
public static int zipcode
public ContactLoader()
public ContactLoader(java.sql.Connection oConn) throws java.sql.SQLException
oConn
- Connectionjava.sql.SQLException
public void setAllColumnsToNull()
setAllColumnsToNull
in interface ImportLoader
public int getColumnIndex(java.lang.String sColumnName)
Get column index at ColumnNames array given its name
This method performs binary search assuming that ColumnNames is sorted in ascending ordergetColumnIndex
in interface ImportLoader
sColumnName
- String Column name (case insensitive)public int columnCount()
ImportLoader
columnCount
in interface ImportLoader
public java.lang.String[] columnNames() throws java.lang.IllegalStateException
ImportLoader
columnNames
in interface ImportLoader
java.lang.IllegalStateException
public void put(int iColumnIndex, java.lang.Object oValue) throws java.lang.ArrayIndexOutOfBoundsException
put
in interface ImportLoader
iColumnIndex
- Column index [0..getColumnCount()-1]oValue
- Value for columnjava.lang.ArrayIndexOutOfBoundsException
public void put(java.lang.String sColumnName, java.lang.Object oValue) throws java.lang.ArrayIndexOutOfBoundsException
Put value for a given column
If a previous value already exists then it is replacedput
in interface ImportLoader
sColumnName
- Column name (case sensitive)oValue
- Value for columnjava.lang.ArrayIndexOutOfBoundsException
public void putAll(java.util.Map oValues)
oValues
- Mappublic java.lang.Object get(int iColumnIndex) throws java.lang.ArrayIndexOutOfBoundsException
get
in interface ImportLoader
iColumnIndex
- int Colunm index [0..getColumnCount()-1]java.lang.ArrayIndexOutOfBoundsException
public java.lang.Object get(java.lang.String sColumnName) throws java.lang.ArrayIndexOutOfBoundsException
get
in interface ImportLoader
sColumnName
- String Column name (case sensitive)java.lang.ArrayIndexOutOfBoundsException
- If no column with sucjh name was foundpublic void prepare(java.sql.Connection oConn, ColumnList oColList) throws java.sql.SQLException
Prepare statements for execution
This method needs to be called only once if the default constructor was used.prepare
in interface ImportLoader
oConn
- Connection Open JDBC database connectionoColList
- ColumnList This parameter is ignoredjava.sql.SQLException
public void close() throws java.sql.SQLException
Close prepared statements
This method must always be called before object is destroyed or elseclose
in interface ImportLoader
java.sql.SQLException
public void store(java.sql.Connection oConn, java.lang.String sWorkArea, int iFlags) throws java.sql.SQLException, java.lang.IllegalArgumentException, java.lang.NullPointerException, java.lang.ClassCastException
store
in interface ImportLoader
oConn
- Opened JDBC connectionsWorkArea
- String GUID of WorkArea to which inserted data will belongiFlags
- int A boolean combination of {MODE_APPEND|MODE_UPDATE|WRITE_COMPANIES|WRITE_CONTACTS|WRITE_ADDRESSES|WRITE_LOOKUPS|NO_DUPLICATED_NAMES|NO_DUPLICATED_MAILS}java.sql.SQLException
java.lang.IllegalArgumentException
java.lang.NullPointerException
java.lang.ClassCastException