当前位置: 首页>>代码示例>>Java>>正文


Java SerializerWriteParams类代码示例

本文整理汇总了Java中com.openbravo.data.loader.SerializerWriteParams的典型用法代码示例。如果您正苦于以下问题:Java SerializerWriteParams类的具体用法?Java SerializerWriteParams怎么用?Java SerializerWriteParams使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SerializerWriteParams类属于com.openbravo.data.loader包,在下文中一共展示了SerializerWriteParams类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateCustomerExt

import com.openbravo.data.loader.SerializerWriteParams; //导入依赖的package包/类
public int updateCustomerExt(final CustomerInfoExt customer) throws BasicException {
 
    return new PreparedSentence(s
            , "UPDATE CUSTOMERS SET NOTES = ? WHERE ID = ?"
            , SerializerWriteParams.INSTANCE      
            ).exec(new DataParams() { public void writeValues() throws BasicException {
                    setString(1, customer.getNotes());
                    setString(2, customer.getId());
            }});        
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:11,代码来源:DataLogicCustomers.java

示例2: syncCustomer

import com.openbravo.data.loader.SerializerWriteParams; //导入依赖的package包/类
public void syncCustomer(final CustomerInfoExt customer) throws BasicException {

        Transaction t = new Transaction(s) {
            public Object transact() throws BasicException {
                // Sync the Customer in a transaction

                // Try to update
                if (new PreparedSentence(s,
                            "UPDATE CUSTOMERS SET SEARCHKEY = ?, NAME = ?, NOTES = ?, VISIBLE = " + s.DB.TRUE() + " WHERE ID = ?",
                            SerializerWriteParams.INSTANCE
                            ).exec(new DataParams() { public void writeValues() throws BasicException {
                                setString(1, customer.getSearchkey());
                                setString(2, customer.getName());
                                setString(3, customer.getAddress());
                                setString(4, customer.getId());
                            }}) == 0) {

                    // If not updated, try to insert
                    new PreparedSentence(s,
                            "INSERT INTO CUSTOMERS(ID, SEARCHKEY, NAME, NOTES, VISIBLE) VALUES (?, ?, ?, ?, " + s.DB.TRUE() + ")",
                            SerializerWriteParams.INSTANCE
                            ).exec(new DataParams() { public void writeValues() throws BasicException {
                                setString(1, customer.getId());
                                setString(2, customer.getSearchkey());
                                setString(3, customer.getName());
                                setString(4, customer.getAddress());
                            }});
                }

                return null;
            }
        };
        t.execute();
    }
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:35,代码来源:DataLogicIntegration.java

示例3: syncTaxCategory

import com.openbravo.data.loader.SerializerWriteParams; //导入依赖的package包/类
public void syncTaxCategory(final TaxCategoryInfo taxcat) throws BasicException {
    
    Transaction t = new Transaction(s) {
        public Object transact() throws BasicException {
            // Sync the Tax in a transaction
            
            // Try to update                
            if (new PreparedSentence(s, 
                        "UPDATE TAXCATEGORIES SET NAME = ?  WHERE ID = ?",
                        SerializerWriteParams.INSTANCE
                        ).exec(new DataParams() { public void writeValues() throws BasicException {
                            setString(1, taxcat.getName());
                            setString(2, taxcat.getID());                                    
                        }}) == 0) {
                   
                // If not updated, try to insert
                new PreparedSentence(s, 
                        "INSERT INTO TAXCATEGORIES(ID, NAME) VALUES (?, ?)", 
                        SerializerWriteParams.INSTANCE
                        ).exec(new DataParams() { public void writeValues() throws BasicException {
                            setString(1, taxcat.getID());
                            setString(2, taxcat.getName());
                        }});
            }
            
            return null;
        }
    };
    t.execute();                   
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:31,代码来源:DataLogicIntegration.java

示例4: syncTax

import com.openbravo.data.loader.SerializerWriteParams; //导入依赖的package包/类
public void syncTax(final TaxInfo tax) throws BasicException {
    
    Transaction t = new Transaction(s) {
        public Object transact() throws BasicException {
            // Sync the Tax in a transaction
            
            // Try to update                
            if (new PreparedSentence(s, 
                        "UPDATE TAXES SET NAME = ?, CATEGORY = ?, CUSTCATEGORY = ?, PARENTID = ?, RATE = ?, RATECASCADE = ? WHERE ID = ?",
                        SerializerWriteParams.INSTANCE
                        ).exec(new DataParams() { public void writeValues() throws BasicException {
                            setString(1, tax.getName());
                            setString(2, tax.getTaxCategoryID());
                            setString(3, tax.getTaxCustCategoryID());
                            setString(4, tax.getParentID());
                            setDouble(5, tax.getRate());
                            setBoolean(6, tax.isCascade());
                            setString(7, tax.getId());       
                        }}) == 0) {
                   
                // If not updated, try to insert
                new PreparedSentence(s, 
                        "INSERT INTO TAXES(ID, NAME, CATEGORY, CUSTCATEGORY, PARENTID, RATE, RATECASCADE) VALUES (?, ?, ?, ?, ?, ?, ?)", 
                        SerializerWriteParams.INSTANCE
                        ).exec(new DataParams() { public void writeValues() throws BasicException {
                            setString(1, tax.getId());
                            setString(2, tax.getName());
                            setString(3, tax.getTaxCategoryID());
                            setString(4, tax.getTaxCustCategoryID());
                            setString(5, tax.getParentID());                                
                            setDouble(6, tax.getRate());
                            setBoolean(7, tax.isCascade());
                        }});
            }
            
            return null;
        }
    };
    t.execute();                   
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:41,代码来源:DataLogicIntegration.java

示例5: syncCategory

import com.openbravo.data.loader.SerializerWriteParams; //导入依赖的package包/类
public void syncCategory(final CategoryInfo cat) throws BasicException {
    
    Transaction t = new Transaction(s) {
        public Object transact() throws BasicException {
            // Sync the Category in a transaction
            
            // Try to update
            if (new PreparedSentence(s, 
                        "UPDATE CATEGORIES SET NAME = ?, IMAGE = ? WHERE ID = ?", 
                        SerializerWriteParams.INSTANCE
                        ).exec(new DataParams() { public void writeValues() throws BasicException {
                             setString(1, cat.getName());
                             setBytes(2, ImageUtils.writeImage(cat.getImage()));
                             setString(3, cat.getID());                                   
                        }}) == 0) {
                   
                // If not updated, try to insert
                new PreparedSentence(s, 
                    "INSERT INTO CATEGORIES(ID, NAME, IMAGE) VALUES (?, ?, ?)",
                    SerializerWriteParams.INSTANCE
                    ).exec(new DataParams() { public void writeValues() throws BasicException {
                        setString(1, cat.getID());
                        setString(2, cat.getName());
                        setBytes(3, ImageUtils.writeImage(cat.getImage()));
                    }});
            }
            return null;        
        }
    };
    t.execute();        
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:32,代码来源:DataLogicIntegration.java

示例6: updateCustomerExt

import com.openbravo.data.loader.SerializerWriteParams; //导入依赖的package包/类
public int updateCustomerExt(final CustomerInfoExt customer) throws BasicException {

        return new PreparedSentence(s
                , "UPDATE CUSTOMERS SET NOTES = ? WHERE ID = ?"
                , SerializerWriteParams.INSTANCE
                ).exec(new DataParams() { public void writeValues() throws BasicException {
                        setString(1, customer.getNotes());
                        setString(2, customer.getId());
                }});
    }
 
开发者ID:nordpos,项目名称:nordpos,代码行数:11,代码来源:DataLogicCustomers.java

示例7: updateCustomerExt

import com.openbravo.data.loader.SerializerWriteParams; //导入依赖的package包/类
public int updateCustomerExt(final CustomerInfoExt customer) throws BasicException {
    // TODO To action on webservice
    return new PreparedSentence(s
            , "UPDATE CUSTOMERS SET NOTES = ? WHERE ID = ?"
            , SerializerWriteParams.INSTANCE      
            ).exec(new DataParams() { public void writeValues() throws BasicException {
                    setString(1, customer.getNotes());
                    setString(2, customer.getId());
            }});        
}
 
开发者ID:ZarGate,项目名称:OpenbravoPOS,代码行数:11,代码来源:DataLogicCustomers.java

示例8: syncCustomer

import com.openbravo.data.loader.SerializerWriteParams; //导入依赖的package包/类
public void syncCustomer(final CustomerInfoExt customer) throws BasicException {

        Transaction t = new Transaction(s) {
            public Object transact() throws BasicException {
                // Sync the Customer in a transaction
                // TODO Do action on webservice
                // Try to update
                if (new PreparedSentence(s,
                            "UPDATE CUSTOMERS SET SEARCHKEY = ?, NAME = ?, NOTES = ?, VISIBLE = " + s.DB.TRUE() + " WHERE ID = ?",
                            SerializerWriteParams.INSTANCE
                            ).exec(new DataParams() { public void writeValues() throws BasicException {
                                setString(1, customer.getSearchkey());
                                setString(2, customer.getName());
                                setString(3, customer.getAddress());
                                setString(4, customer.getId());
                            }}) == 0) {

                    // If not updated, try to insert
                    new PreparedSentence(s,
                            "INSERT INTO CUSTOMERS(ID, SEARCHKEY, NAME, NOTES, VISIBLE) VALUES (?, ?, ?, ?, " + s.DB.TRUE() + ")",
                            SerializerWriteParams.INSTANCE
                            ).exec(new DataParams() { public void writeValues() throws BasicException {
                                setString(1, customer.getId());
                                setString(2, customer.getSearchkey());
                                setString(3, customer.getName());
                                setString(4, customer.getAddress());
                            }});
                }

                return null;
            }
        };
        t.execute();
    }
 
开发者ID:ZarGate,项目名称:OpenbravoPOS,代码行数:35,代码来源:DataLogicIntegration.java

示例9: syncProduct

import com.openbravo.data.loader.SerializerWriteParams; //导入依赖的package包/类
public void syncProduct(final ProductInfoExt prod) throws BasicException {
    
    Transaction t = new Transaction(s) {
        public Object transact() throws BasicException {
            // Sync the Product in a transaction
            
            // Try to update
            if (new PreparedSentence(s, 
                        "UPDATE PRODUCTS SET REFERENCE = ?, CODE = ?, NAME = ?, PRICEBUY = ?, PRICESELL = ?, CATEGORY = ?, TAXCAT = ?, IMAGE = ? WHERE ID = ?", 
                        SerializerWriteParams.INSTANCE
                        ).exec(new DataParams() { public void writeValues() throws BasicException {
                            setString(1, prod.getReference());
                            setString(2, prod.getCode());
                            setString(3, prod.getName());
                            // setBoolean(x, p.isCom());
                            // setBoolean(x, p.isScale());
                            setDouble(4, prod.getPriceBuy());
                            setDouble(5, prod.getPriceSell());
                            setString(6, prod.getCategoryID());
                            setString(7, prod.getTaxCategoryID());
                            setBytes(8, ImageUtils.writeImage(prod.getImage()));
                            // setDouble(x, 0.0);
                            // setDouble(x, 0.0);
                            setString(9, prod.getID());  
                        }}) == 0) {
                        
                // If not updated, try to insert
                new PreparedSentence(s, 
                        "INSERT INTO PRODUCTS (ID, REFERENCE, CODE, NAME, ISCOM, ISSCALE, PRICEBUY, PRICESELL, CATEGORY, TAXCAT, IMAGE, STOCKCOST, STOCKVOLUME) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
                        SerializerWriteParams.INSTANCE
                        ).exec(new DataParams() { public void writeValues() throws BasicException {
                            setString(1, prod.getID());
                            setString(2, prod.getReference());
                            setString(3, prod.getCode());
                            setString(4, prod.getName());
                            setBoolean(5, prod.isCom());
                            setBoolean(6, prod.isScale());
                            setDouble(7, prod.getPriceBuy());
                            setDouble(8, prod.getPriceSell());
                            setString(9, prod.getCategoryID());
                            setString(10, prod.getTaxCategoryID());
                            setBytes(11, ImageUtils.writeImage(prod.getImage()));
                            setDouble(12, 0.0);
                            setDouble(13, 0.0);                               
                        }});
            }
                    
            // Insert in catalog
            new StaticSentence(s, 
                    "INSERT INTO PRODUCTS_CAT(PRODUCT, CATORDER) VALUES (?, NULL)",
                    SerializerWriteString.INSTANCE
                    ).exec(prod.getID());   
            
            return null;        
        }
    };
    t.execute();     
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:59,代码来源:DataLogicIntegration.java

示例10: syncProduct

import com.openbravo.data.loader.SerializerWriteParams; //导入依赖的package包/类
public void syncProduct(final ProductInfoExt prod) throws BasicException {
    
    Transaction t = new Transaction(s) {
        public Object transact() throws BasicException {
            // Sync the Product in a transaction
            
            // Try to update
            if (new PreparedSentence(s, 
                        "UPDATE PRODUCTS SET REFERENCE = ?, CODE = ?, NAME = ?, PRICEBUY = ?, PRICESELL = ?, CATEGORY = ?, TAXCAT = ?, IMAGE = ? WHERE ID = ?", 
                        SerializerWriteParams.INSTANCE
                        ).exec(new DataParams() { public void writeValues() throws BasicException {
                            setString(1, prod.getReference());
                            setString(2, prod.getCode());
                            setString(3, prod.getName());
                            // setBoolean(x, p.isCom());
                            // setBoolean(x, p.isScale());
                            setDouble(4, prod.getPriceBuy());
                            setDouble(5, prod.getPriceSell());
                            setString(6, prod.getCategoryID());
                            setString(7, prod.getTaxCategoryID());
                            setBytes(8, ImageUtils.writeImage(prod.getImage()));
                            // setDouble(x, 0.0);
                            // setDouble(x, 0.0);
                            setString(9, prod.getID());  
                        }}) == 0) {
                        
                // If not updated, try to insert
                new PreparedSentence(s, 
                        "INSERT INTO PRODUCTS (ID, REFERENCE, CODE, NAME, ISCOM, ISSCALE, ISKITCHENPRINT, PRICEBUY, PRICESELL, CATEGORY, TAXCAT, IMAGE, STOCKCOST, STOCKVOLUME) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
                        SerializerWriteParams.INSTANCE
                        ).exec(new DataParams() { public void writeValues() throws BasicException {
                            setString(1, prod.getID());
                            setString(2, prod.getReference());
                            setString(3, prod.getCode());
                            setString(4, prod.getName());
                            setBoolean(5, prod.isCom());
                            setBoolean(6, prod.isScale());
                            setBoolean(7, prod.isKitchenPrint());
                            setDouble(8, prod.getPriceBuy());
                            setDouble(9, prod.getPriceSell());
                            setString(10, prod.getCategoryID());
                            setString(11, prod.getTaxCategoryID());
                            setBytes(12, ImageUtils.writeImage(prod.getImage()));
                            setDouble(13, 0.0);
                            setDouble(14, 0.0);                               
                        }});
            }
                    
            // Insert in catalog
            new StaticSentence(s, 
                    "INSERT INTO PRODUCTS_CAT(PRODUCT, CATORDER) VALUES (?, NULL)",
                    SerializerWriteString.INSTANCE
                    ).exec(prod.getID());   
            
            return null;        
        }
    };
    t.execute();     
}
 
开发者ID:ZarGate,项目名称:OpenbravoPOS,代码行数:60,代码来源:DataLogicIntegration.java


注:本文中的com.openbravo.data.loader.SerializerWriteParams类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。