Package easyJ.database.session

Examples of easyJ.database.session.Session.update()


    public void update(Object o) throws EasyJException {
        Session session = null;
        try {

            session = SessionFactory.openSession();
            session.update(o);
        } finally {
            if (session != null)
                session.close();
        }
View Full Code Here


                        clazz, easyJ.common.Const.PRIMARY_KEY);
                Filter filter = DAOFactory.getFilter(primaryKey,
                        SQLOperator.EQUAL, primaryKeys[i]);
                ucmd.setFilter(filter);
                // EasyJLog.debug(ucmd.getExecutableSQL());
                session.update(ucmd);
            }
        } finally {
            if (session != null)
                session.close();
        }
View Full Code Here

    public void update(Object o) throws easyJ.common.EasyJException {
        Session session = null;
        try {
            session = SessionFactory.openSession();
            Class clazz = o.getClass();
            session.update(o);
            String[] subClassProperties = BeanUtil.getSubClassProperties(clazz);
            for (int i = 0; i < subClassProperties.length; i++) {
                String property = subClassProperties[i];
                ArrayList propertyValues = (ArrayList) BeanUtil.getFieldValue(
                        o, property);
View Full Code Here

                        o, property);
                for (int j = 0; j < propertyValues.size(); j++) {
                    Object primaryKeyValue = BeanUtil
                            .getPrimaryKeyValue(propertyValues.get(j));
                    if (primaryKeyValue != null)
                        session.update(propertyValues.get(j));
                    else
                        session.create(propertyValues.get(j));
                }
            }
        } finally {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.