Examples of byNaturalId()


Examples of org.hibernate.Session.byNaturalId()

         @Override
         public Citizen call() throws Exception {
            Session s = openSession();
            Transaction tx = s.beginTransaction();
            State france = BasicTransactionalTestCase.this.getState(s, "Ile de France");
            NaturalIdLoadAccess naturalIdLoader = s.byNaturalId(Citizen.class);
            naturalIdLoader.using("ssn", "1234").using("state", france);

            //Not clearing naturalId caches, should be warm from entity loading
            stats.clear();
View Full Code Here

Examples of org.hibernate.Session.byNaturalId()

         @Override
         public Void call() throws Exception {
            Session s = openSession();
            Transaction tx = s.beginTransaction();
            State france = BasicTransactionalTestCase.this.getState(s, "Ile de France");
            NaturalIdLoadAccess naturalIdLoader = s.byNaturalId(Citizen.class);
            naturalIdLoader.using( "ssn", "1234" ).using( "state", france );

            //Not clearing naturalId caches, should be warm from entity loading
            stats.setStatisticsEnabled( true );
            stats.clear();
View Full Code Here

Examples of org.hibernate.Session.byNaturalId()

    }

    @Override
    protected HProjectIteration loadInstance() {
        Session session = (Session) getEntityManager().getDelegate();
        return (HProjectIteration) session.byNaturalId(HProjectIteration.class)
                .using("slug", getSlug())
                .using("project", projectDAO.getBySlug(projectSlug)).load();
    }

    @Restrict("#{s:hasPermission(versionHome.instance, 'update')}")
View Full Code Here

Examples of org.hibernate.Session.byNaturalId()

    }

    @Override
    protected HProject loadInstance() {
        Session session = (Session) getEntityManager().getDelegate();
        return (HProject) session.byNaturalId(HProject.class)
                .using("slug", getSlug()).load();
    }

    public void validateSuppliedId() {
        HProject ip = getInstance(); // this will raise an EntityNotFound
View Full Code Here

Examples of org.hibernate.Session.byNaturalId()

    }

    @Override
    protected HIterationGroup loadInstance() {
        Session session = (Session) getEntityManager().getDelegate();
        return (HIterationGroup) session.byNaturalId(HIterationGroup.class)
                .using("slug", getSlug()).load();
    }

    // sort by slug
    public List<HProjectIteration> getSortedInstanceProjectIterations() {
View Full Code Here

Examples of org.hibernate.Session.byNaturalId()

            session = entityManager.unwrap(Session.class);
        }
        catch (IllegalStateException e) {
            throw new IllegalStateException("The DAO Method that calls createNaturalIdQuery must be annotated with @OpenEntityManager or @Transactional", e);
        }
        final NaturalIdLoadAccess naturalIdLoadAccess = session.byNaturalId(entityType);
        return new NaturalIdQuery<T>(entityType, naturalIdLoadAccess);
    }

    /**
     * Creates the cache region name for the criteria query
View Full Code Here

Examples of org.hibernate.Session.byNaturalId()

         @Override
         public Citizen call() throws Exception {
            Session s = openSession();
            Transaction tx = s.beginTransaction();
            State france = BasicTransactionalTestCase.this.getState(s, "Ile de France");
            NaturalIdLoadAccess naturalIdLoader = s.byNaturalId(Citizen.class);
            naturalIdLoader.using("ssn", "1234").using("state", france);

            //Not clearing naturalId caches, should be warm from entity loading
            stats.clear();
View Full Code Here

Examples of org.hibernate.Session.byNaturalId()

         @Override
         public Void call() throws Exception {
            Session s = openSession();
            Transaction tx = s.beginTransaction();
            State france = BasicTransactionalTestCase.this.getState(s, "Ile de France");
            NaturalIdLoadAccess naturalIdLoader = s.byNaturalId(Citizen.class);
            naturalIdLoader.using( "ssn", "1234" ).using( "state", france );

            //Not clearing naturalId caches, should be warm from entity loading
            stats.setStatisticsEnabled( true );
            stats.clear();
View Full Code Here

Examples of org.hibernate.Session.byNaturalId()

    }

    private void prepareAccount() {
        Session session = getSession();
        String username = "anAuthenticatedAccount";
        HAccount account = (HAccount) session.byNaturalId(HAccount.class).using("username", username).load();
        if (account == null) {
            account = new HAccount();
            account.setUsername(username);
            HPerson person = new HPerson();
            person.setEmail("email@example.com");
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.