public class ProductLoader extends java.lang.Object implements ImportLoader
Load Product data from a single source
Modifier and Type | Field and Description |
---|---|
static int |
adult_rated |
static int |
alturl |
static int |
author |
static int |
availability |
static int |
bo_active |
static int |
brand |
static int |
client |
static int |
color |
static int |
contact_person |
static int |
coord_x |
static int |
coord_y |
static int |
country |
static int |
country_code |
static int |
cover |
static int |
days_to_deliver |
static int |
de_prod_locat |
static int |
de_product |
static int |
department |
static int |
direct_phone |
static int |
disk_space |
static int |
display |
static int |
doc_no |
static int |
dt_acknowledge |
static int |
dt_created |
static int |
dt_end |
static int |
dt_expire |
static int |
dt_modified |
static int |
dt_out |
static int |
dt_start |
static int |
dt_uploaded |
static int |
email |
static int |
fax |
static int |
fax_phone |
static int |
forward_to |
static int |
gu_address |
static int |
gu_blockedby |
static int |
gu_category |
static int |
gu_location |
static int |
gu_owner |
static int |
gu_product |
static int |
gu_user |
static int |
home_phone |
static int |
icq_id |
static int |
id_cont_type |
static int |
id_country |
static int |
id_currency |
static int |
id_fare |
static int |
id_language |
static int |
id_prod_type |
static int |
id_ref |
static int |
id_state |
static int |
id_status |
static int |
ip_addr |
static int |
is_compound |
static int |
is_tax_included |
static int |
isbn |
static int |
ix_address |
static int |
len_file |
static int |
memory |
static int |
mn_city |
static int |
mobilephone |
static int |
MODE_APPEND |
static int |
MODE_APPENDUPDATE |
static int |
MODE_UPDATE |
static int |
mov_phone |
static int |
nm_category |
static int |
nm_company |
static int |
nm_country |
static int |
nm_product |
static int |
nm_state |
static int |
nm_street |
static int |
NO_DUPLICATED_NAMES |
static int |
NO_DUPLICATED_REFERENCES |
static int |
nu_current_stock |
static int |
nu_lines |
static int |
nu_min_stock |
static int |
nu_reserved_stock |
static int |
nu_street |
static int |
od_position |
static int |
office |
static int |
ordinal |
static int |
organization |
static int |
other_phone |
static int |
pages |
static int |
paragraphs |
static int |
pct_tax_rate |
static int |
pg_prod_locat |
static int |
phone1 |
static int |
phone2 |
static int |
po_box |
static int |
power |
static int |
pr_discount |
static int |
pr_list |
static int |
pr_purchase |
static int |
pr_sale |
static int |
product_group |
static int |
project |
static int |
rank |
static int |
reference_id |
static int |
revised_by |
static int |
rooms |
static int |
scope |
static int |
signature |
static int |
size_x |
static int |
size_y |
static int |
size_z |
static int |
speed |
static int |
state |
static int |
state_code |
static int |
status |
static int |
subject |
static int |
tag_prod_locat |
static int |
tag_product |
static int |
target |
static int |
template |
static int |
tp_fare |
static int |
tp_location |
static int |
tp_street |
static int |
tx_addr1 |
static int |
tx_addr2 |
static int |
tx_email |
static int |
tx_email_alt |
static int |
tx_keywords |
static int |
tx_remarks |
static int |
tx_salutation |
static int |
typeof |
static int |
upload_by |
static int |
url_addr |
static int |
vs_stamp |
static int |
weight |
static int |
words |
static int |
work_phone |
static int |
WRITE_ADDRESSES |
static int |
WRITE_LOOKUPS |
static int |
xanchor |
static int |
xfile |
static int |
xhost |
static int |
xoriginalfile |
static int |
xpath |
static int |
xport |
static int |
xprotocol |
static int |
zip_code |
LOOUKP_TR_COLUMNS, LOOUKP_TR_COUNT
Constructor and Description |
---|
ProductLoader() |
ProductLoader(java.sql.Connection oConn)
Create ProductLoader 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
cursors may be left open at the database
|
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_ADDRESSES
public static final int NO_DUPLICATED_NAMES
public static final int NO_DUPLICATED_REFERENCES
public static int adult_rated
public static int alturl
public static int author
public static int availability
public static int bo_active
public static int brand
public static int client
public static int color
public static int contact_person
public static int coord_x
public static int coord_y
public static int country
public static int country_code
public static int cover
public static int days_to_deliver
public static int de_prod_locat
public static int de_product
public static int department
public static int direct_phone
public static int disk_space
public static int display
public static int doc_no
public static int dt_acknowledge
public static int dt_created
public static int dt_end
public static int dt_expire
public static int dt_modified
public static int dt_out
public static int dt_start
public static int dt_uploaded
public static int email
public static int fax
public static int fax_phone
public static int forward_to
public static int gu_address
public static int gu_blockedby
public static int gu_category
public static int gu_location
public static int gu_owner
public static int gu_product
public static int gu_user
public static int home_phone
public static int icq_id
public static int id_cont_type
public static int id_country
public static int id_currency
public static int id_fare
public static int id_language
public static int id_prod_type
public static int id_ref
public static int id_state
public static int id_status
public static int ip_addr
public static int is_compound
public static int is_tax_included
public static int isbn
public static int ix_address
public static int len_file
public static int memory
public static int mn_city
public static int mobilephone
public static int mov_phone
public static int nm_category
public static int nm_company
public static int nm_country
public static int nm_product
public static int nm_state
public static int nm_street
public static int nu_current_stock
public static int nu_lines
public static int nu_min_stock
public static int nu_reserved_stock
public static int nu_street
public static int od_position
public static int office
public static int ordinal
public static int organization
public static int other_phone
public static int pages
public static int paragraphs
public static int pct_tax_rate
public static int pg_prod_locat
public static int phone1
public static int phone2
public static int po_box
public static int power
public static int pr_discount
public static int pr_list
public static int pr_purchase
public static int pr_sale
public static int product_group
public static int project
public static int rank
public static int reference_id
public static int revised_by
public static int rooms
public static int scope
public static int signature
public static int size_x
public static int size_y
public static int size_z
public static int speed
public static int state
public static int state_code
public static int status
public static int subject
public static int tag_prod_locat
public static int tag_product
public static int target
public static int template
public static int tp_fare
public static int tp_location
public static int tp_street
public static int tx_addr1
public static int tx_addr2
public static int tx_email
public static int tx_email_alt
public static int tx_keywords
public static int tx_remarks
public static int tx_salutation
public static int typeof
public static int upload_by
public static int url_addr
public static int vs_stamp
public static int weight
public static int words
public static int work_phone
public static int xanchor
public static int xfile
public static int xhost
public static int xoriginalfile
public static int xpath
public static int xport
public static int xprotocol
public static int zip_code
public ProductLoader()
public ProductLoader(java.sql.Connection oConn) throws java.sql.SQLException
oConn
- Connectionjava.sql.SQLException
public 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 else cursors may be left open at the databaseclose
in interface ImportLoader
java.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 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_ADDRESSES|WRITE_LOOKUPS|NO_DUPLICATED_NAMES|NO_DUPLICATED_REFERENCES}java.sql.SQLException
java.lang.IllegalArgumentException
java.lang.NullPointerException
java.lang.ClassCastException