@@ -0,0 +1,1319 @@
+package com.aemreunal.repository.user;%0A%0A/*%0A ***************************%0A * Copyright (c) 2014      *%0A *                         *%0A * This code belongs to:   *%0A *                         *%0A * @author Ahmet Emre %C3%9Cnal *%0A * S001974                 *%0A *                         *%0A * aemreunal@gmail.com     *%0A * emre.unal@ozu.edu.tr    *%0A *                         *%0A * aemreunal.com           *%0A ***************************%0A */%0A%0Aimport javax.persistence.criteria.CriteriaBuilder;%0Aimport javax.persistence.criteria.CriteriaQuery;%0Aimport javax.persistence.criteria.Predicate;%0Aimport javax.persistence.criteria.Root;%0Aimport org.springframework.data.jpa.domain.Specification;%0Aimport com.aemreunal.domain.User;%0A%0Apublic class UserSpecs %7B%0A    /**%0A     * Creates the User search specification by the given username.%0A     *%0A     * @param username%0A     *     The username of the User to find%0A     *%0A     * @return The specification of the user with the given username%0A     */%0A    public static Specification%3CUser%3E usernameSpecification(final String username) %7B%0A        return new Specification%3CUser%3E() %7B%0A            public Predicate toPredicate(Root%3CUser%3E root, CriteriaQuery%3C?%3E query, CriteriaBuilder builder) %7B%0A                return builder.equal(root.get(%22username%22).as(String.class), username);%0A            %7D%0A        %7D;%0A    %7D%0A%7D%0A

Create User specifications class