Package acceptance.hibernate.reference

Examples of acceptance.hibernate.reference.Person


        final Session session = getSessionFactory().getCurrentSession();
        session.beginTransaction();
        final Division loaded = (Division)session.createQuery("from Division").uniqueResult();
        final Department dept = (Department)loaded.getDepartments().iterator().next();
        final Person person = (Person)dept.getPeople().iterator().next();
        final Site site = person.getSite();
        assertTrue(HibernateProxy.class.isAssignableFrom(site.getClass()));
        final String loadedXml = xstream.toXML(site);
        session.getTransaction().commit();

        final String expectedXml = ""
View Full Code Here


         * depth-first and does not do a full graph analysis. Therefore it would be possible for
         * Hibernate to try to save the person record before the site record, which would throw
         * an error if the person.site FK is non-nullable.
         */
        session.save(site);
        new Person("Tom", dep, site);
        session.save(div);
        session.getTransaction().commit();
        return div;
    }
View Full Code Here

     */
    private Division setupNonpersistentDivision() {
        final Division div = new Division("Div1");
        final Department dep = new Department("Dep1", div);
        final Site site = new Site("Site1");
        new Person("Tom", dep, site);
        return div;
    }
View Full Code Here

TOP

Related Classes of acceptance.hibernate.reference.Person

Copyright © 2018 www.massapicom. 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.