@@ -0,0 +1,2942 @@
+/*%0A * Copyright 2016-2018 shardingsphere.io.%0A * %3Cp%3E%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A * %3C/p%3E%0A */%0A%0Apackage io.shardingsphere.example.repository.jpa.repository;%0A%0Aimport io.shardingsphere.example.repository.api.entity.OrderEncrypt;%0Aimport io.shardingsphere.example.repository.api.entity.OrderItem;%0Aimport io.shardingsphere.example.repository.api.repository.OrderEncryptRepository;%0Aimport org.springframework.stereotype.Repository;%0A%0Aimport javax.persistence.EntityManager;%0Aimport javax.persistence.PersistenceContext;%0Aimport javax.persistence.Query;%0Aimport javax.transaction.Transactional;%0Aimport java.util.List;%0A%0A@Repository%0A@Transactional%0Apublic class JPAOrderEncryptRepositoryImpl implements OrderEncryptRepository %7B%0A    %0A    @PersistenceContext%0A    private EntityManager entityManager;%0A    %0A    @Override%0A    public void createTableIfNotExists() %7B%0A        throw new UnsupportedOperationException(%22createTableIfNotExists for JPA%22);%0A    %7D%0A    %0A    @Override%0A    public void truncateTable() %7B%0A        throw new UnsupportedOperationException(%22truncateTable for JPA%22);%0A    %7D%0A    %0A    @Override%0A    public void dropTable() %7B%0A        throw new UnsupportedOperationException(%22dropTable for JPA%22);%0A    %7D%0A    %0A    @Override%0A    public Long insert(final OrderEncrypt orderEncrypt) %7B%0A        entityManager.persist(orderEncrypt);%0A        return orderEncrypt.getOrderId();%0A    %7D%0A    %0A    @Override%0A    public void delete(final Long md5Id) %7B%0A        Query query = entityManager.createQuery(%22DELETE FROM OrderEncryptEntity e WHERE e.md5Id = ?1%22);%0A        query.setParameter(1, md5Id);%0A        query.executeUpdate();%0A    %7D%0A    %0A    @Override%0A    public void update(final String aesId) %7B%0A        Query query = entityManager.createQuery(%22UPDATE OrderEncryptEntity SET e.aesId = 11 WHERE e.aesId = ?1%22);%0A        query.setParameter(1, aesId);%0A        query.executeUpdate();%0A    %7D%0A    %0A    @SuppressWarnings(%22unchecked%22)%0A    @Override%0A    public List%3COrderEncrypt%3E selectAll() %7B%0A        return (List%3COrderEncrypt%3E) entityManager.createQuery(%22SELECT e FROM OrderEntity o, OrderEncryptEntity e WHERE o.orderId = e.orderId%22).getResultList();%0A    %7D%0A    %0A    @SuppressWarnings(%22unchecked%22)%0A    @Override%0A    public List%3COrderEncrypt%3E selectRange() %7B%0A        return (List%3COrderEncrypt%3E) entityManager.createQuery(%22SELECT e FROM OrderEntity o, OrderEncryptEntity e WHERE o.orderId = e.orderId AND o.userId BETWEEN 1 AND 5%22).getResultList();%0A    %7D%0A%7D%0A

add JPAOrderEncryptRepositoryImpl