Package javax.persistence.criteria

Examples of javax.persistence.criteria.CriteriaUpdate.where()


    public void updateMovie() {
        CriteriaBuilder builder = em.getCriteriaBuilder();
        CriteriaUpdate updateCriteria = builder.createCriteriaUpdate(Movie.class);
        Root<Movie> updateRoot = updateCriteria.from(Movie.class);
        updateCriteria.where(builder.equal(updateRoot.get(Movie_.name), "Inception"));
        updateCriteria.set(updateRoot.get(Movie_.name), "INCEPTION");
        Query q = em.createQuery(updateCriteria);
        q.executeUpdate();
        em.flush();
    }
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.