+" WHERE status=1 AND code=?", Integer.class, langCode);
//Attribute
String table = quoteTable("attribute_description");
String sql = "SELECT attribute_id, name FROM " +table+ " WHERE language_id = ?";
List<Object[]> rows = getJdbcOperations().query(sql, new Object[]{defaultLangId}, new ArrayListResultSetExtractor());
sql = "INSERT INTO " +table + " SET attribute_id = ?, language_id = ?, name = ?";
for(Object[] row: rows){
getJdbcOperations().update(sql, row[0], langId, row[1]);
}
//AttributeGroup
table = quoteTable("attribute_group_description");
sql = "SELECT attribute_group_id, name FROM " +table+ " WHERE language_id = ?";
rows = getJdbcOperations().query(sql, new Object[]{defaultLangId}, new ArrayListResultSetExtractor());
sql = "INSERT INTO " +table + " SET attribute_group_id = ?, language_id = ?, name = ?";
for(Object[] row: rows){
getJdbcOperations().update(sql, row[0], langId, row[1]);
}
//Banner
table = quoteTable("banner_image_description");
sql = "SELECT banner_image_id,banner_id,title name FROM " +table+ " WHERE language_id = ?";
rows = getJdbcOperations().query(sql, new Object[]{defaultLangId}, new ArrayListResultSetExtractor());
sql = "INSERT INTO " +table + " SET banner_image_id = ?, banner_id=?, language_id = ?, title = ?";
for(Object[] row: rows){
getJdbcOperations().update(sql, row[0], row[1], langId, row[2]);
}
//Category
table = quoteTable("category_description");
sql = "SELECT category_id, name, meta_description, meta_keyword, description FROM " +table+ " WHERE language_id = ?";
rows = getJdbcOperations().query(sql, new Object[]{defaultLangId}, new ArrayListResultSetExtractor());
sql = "INSERT INTO " +table + " SET category_id = ?, language_id = ?, name = ?, meta_description=?, meta_keyword = ?, description = ?";
for(Object[] row: rows){
getJdbcOperations().update(sql, row[0], langId, row[1], row[2], row[3], row[4]);
}
//CustomerGroup
table = quoteTable("customer_group_description");
sql = "SELECT customer_group_id, name, description FROM " +table+ " WHERE language_id = ?";
rows = getJdbcOperations().query(sql, new Object[]{defaultLangId}, new ArrayListResultSetExtractor());
sql = "INSERT INTO " +table + " SET customer_group_id = ?, language_id = ?, name = ?, description = ?";
for(Object[] row: rows){
getJdbcOperations().update(sql, row[0], langId, row[1], row[2]);
}
//Download
table = quoteTable("download_description");
sql = "SELECT download_id, name FROM " +table+ " WHERE language_id = ?";
rows = getJdbcOperations().query(sql, new Object[]{defaultLangId}, new ArrayListResultSetExtractor());
sql = "INSERT INTO " +table + " SET download_id = ?, language_id = ?, name = ?";
for(Object[] row: rows){
getJdbcOperations().update(sql, row[0], langId, row[1]);
}
//Filter
table = quoteTable("filter_description");
sql = "SELECT filter_id, name FROM " +table+ " WHERE language_id = ?";
rows = getJdbcOperations().query(sql, new Object[]{defaultLangId}, new ArrayListResultSetExtractor());
sql = "INSERT INTO " +table + " SET filter_id = ?, language_id = ?, name = ?";
for(Object[] row: rows){
getJdbcOperations().update(sql, row[0], langId, row[1]);
}
//Information
table = quoteTable("information_description");
sql = "SELECT information_id, title, description FROM " +table+ " WHERE language_id = ?";
rows = getJdbcOperations().query(sql, new Object[]{defaultLangId}, new ArrayListResultSetExtractor());
sql = "INSERT INTO " +table + " SET information_id = ?, language_id = ?, title = ?, description=?";
for(Object[] row: rows){
getJdbcOperations().update(sql, row[0], langId, row[1], row[2]);
}
//Length
table = quoteTable("length_class_description");
sql = "SELECT length_class_id, title, unit FROM " +table+ " WHERE language_id = ?";
rows = getJdbcOperations().query(sql, new Object[]{defaultLangId}, new ArrayListResultSetExtractor());
sql = "INSERT INTO " +table + " SET length_class_id = ?, language_id = ?, title = ?, unit=?";
for(Object[] row: rows){
getJdbcOperations().update(sql, row[0], langId, row[1], row[2]);
}
//Option
table = quoteTable("option_description");
sql = "SELECT option_id, name FROM " +table+ " WHERE language_id = ?";
rows = getJdbcOperations().query(sql, new Object[]{defaultLangId}, new ArrayListResultSetExtractor());
sql = "INSERT INTO " +table + " SET option_id = ?, language_id = ?, name = ?";
for(Object[] row: rows){
getJdbcOperations().update(sql, row[0], langId, row[1]);
}
//Option value
table = quoteTable("option_value_description");
sql = "SELECT option_value_id, option_id, name FROM " +table+ " WHERE language_id = ?";
rows = getJdbcOperations().query(sql, new Object[]{defaultLangId}, new ArrayListResultSetExtractor());
sql = "INSERT INTO " +table + " SET option_value_id = ?, language_id = ?, option_id = ?, name = ?";
for(Object[] row: rows){
getJdbcOperations().update(sql, row[0], langId, row[1], row[2]);
}
//Order Status
table = quoteTable("order_status");
sql = "SELECT order_status_id, name FROM " +table+ " WHERE language_id = ?";
rows = getJdbcOperations().query(sql, new Object[]{defaultLangId}, new ArrayListResultSetExtractor());
sql = "INSERT INTO " +table + " SET order_status_id = ?, language_id = ?, name = ?";
for(Object[] row: rows){
getJdbcOperations().update(sql, row[0], langId, row[1]);
}
//Product
table = quoteTable("product_description");
sql = "SELECT product_id, name, meta_description, meta_keyword, description, tag FROM " +table+ " WHERE language_id = ?";
rows = getJdbcOperations().query(sql, new Object[]{defaultLangId}, new ArrayListResultSetExtractor());
sql = "INSERT INTO " +table + " SET product_id = ?, language_id = ?, name = ?, meta_description = ?, meta_keyword = ?, description = ?, tag = ?";
for(Object[] row: rows){
getJdbcOperations().update(sql, row[0], langId, row[1], row[2], row[3], row[4], row[5]);
}
//Product Attribute
table = quoteTable("product_attribute");
sql = "SELECT product_id, attribute_id, text FROM " +table+ " WHERE language_id = ?";
rows = getJdbcOperations().query(sql, new Object[]{defaultLangId}, new ArrayListResultSetExtractor());
sql = "INSERT INTO " +table + " SET product_id = ?, language_id = ?, attribute_id = ?, text = ?";
for(Object[] row: rows){
getJdbcOperations().update(sql, row[0], langId, row[1], row[2]);
}
//Return Action
table = quoteTable("return_action");
sql = "SELECT return_action_id, name FROM " +table+ " WHERE language_id = ?";
rows = getJdbcOperations().query(sql, new Object[]{defaultLangId}, new ArrayListResultSetExtractor());
sql = "INSERT INTO " +table + " SET return_action_id = ?, language_id = ?, name = ?";
for(Object[] row: rows){
getJdbcOperations().update(sql, row[0], langId, row[1]);
}
//Return Reason
table = quoteTable("return_reason");
sql = "SELECT return_reason_id, name FROM " +table+ " WHERE language_id = ?";
rows = getJdbcOperations().query(sql, new Object[]{defaultLangId}, new ArrayListResultSetExtractor());
sql = "INSERT INTO " +table + " SET return_reason_id = ?, language_id = ?, name = ?";
for(Object[] row: rows){
getJdbcOperations().update(sql, row[0], langId, row[1]);
}
//Return Status
table = quoteTable("return_status");
sql = "SELECT return_status_id, name FROM " +table+ " WHERE language_id = ?";
rows = getJdbcOperations().query(sql, new Object[]{defaultLangId}, new ArrayListResultSetExtractor());
sql = "INSERT INTO " +table + " SET return_status_id = ?, language_id = ?, name = ?";
for(Object[] row: rows){
getJdbcOperations().update(sql, row[0], langId, row[1]);
}
//Stock Status
table = quoteTable("stock_status");
sql = "SELECT stock_status_id, name FROM " +table+ " WHERE language_id = ?";
rows = getJdbcOperations().query(sql, new Object[]{defaultLangId}, new ArrayListResultSetExtractor());
sql = "INSERT INTO " +table + " SET stock_status_id = ?, language_id = ?, name = ?";
for(Object[] row: rows){
getJdbcOperations().update(sql, row[0], langId, row[1]);
}
//Voucher Theme
table = quoteTable("voucher_theme_description");
sql = "SELECT voucher_theme_id, name FROM " +table+ " WHERE language_id = ?";
rows = getJdbcOperations().query(sql, new Object[]{defaultLangId}, new ArrayListResultSetExtractor());
sql = "INSERT INTO " +table + " SET voucher_theme_id = ?, language_id = ?, name = ?";
for(Object[] row: rows){
getJdbcOperations().update(sql, row[0], langId, row[1]);
}
//Weight Class
table = quoteTable("weight_class_description");
sql = "SELECT weight_class_id, title, unit FROM " +table+ " WHERE language_id = ?";
rows = getJdbcOperations().query(sql, new Object[]{defaultLangId}, new ArrayListResultSetExtractor());
sql = "INSERT INTO " +table + " SET weight_class_id = ?, language_id = ?, title = ?, unit = ?";
for(Object[] row: rows){
getJdbcOperations().update(sql, row[0], langId, row[1], row[2]);
}
}