Package easyJ.database.session

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


    public Object create(Object o) throws EasyJException {
        Session session = null;
        try {
            session = SessionFactory.openSession();
            o = session.create(o);
            return o;
        } finally {
            if (session != null)
                session.close();
        }
View Full Code Here


    public Object create(Object o) throws easyJ.common.EasyJException {
        Session session = null;
        try {
            session = SessionFactory.openSession();
            Class clazz = o.getClass();
            o = session.create(o);
            String primaryKeyName = BeanUtil.getPrimaryKeyName(o.getClass());
            Object primaryKeyValue = BeanUtil.getPrimaryKeyValue(o);
            String[] subClassProperties = BeanUtil.getSubClassProperties(clazz);
            for (int i = 0; i < subClassProperties.length; i++) {
                String property = subClassProperties[i];
View Full Code Here

                for (int j = 0; j < propertyValues.size(); j++) {
                    Object detail = propertyValues.get(j);
                    BeanUtil.setFieldValue(detail, primaryKeyName,
                            primaryKeyValue);
                    session.create(detail);
                }
            }
        } finally {
            if (session != null)
                session.close();
View Full Code Here

                    Object primaryKeyValue = BeanUtil
                            .getPrimaryKeyValue(propertyValues.get(j));
                    if (primaryKeyValue != null)
                        session.update(propertyValues.get(j));
                    else
                        session.create(propertyValues.get(j));
                }
            }
        } finally {
            if (session != null)
                session.close();
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.