Loading example-common/repository-api/src/main/java/org/apache/shardingsphere/example/common/repository/CommonRepository.java +25 −3 Original line number Diff line number Diff line Loading @@ -19,17 +19,39 @@ package org.apache.shardingsphere.example.common.repository; import java.util.List; public interface CommonRepository<T> { public interface CommonRepository<T, P> { /** * Create table if not exist. */ void createTableIfNotExists(); /** * Drop table. */ void dropTable(); /** * Truncate table. */ void truncateTable(); Long insert(T entity); /** * insert one entity. * @param entity entity * @return primary key */ P insert(T entity); void delete(Long id); /** * Do delete. * @param key key */ void delete(P key); /** * select all. * @return list of entity */ List<T> selectAll(); } example-common/repository-api/src/main/java/org/apache/shardingsphere/example/common/repository/OrderItemRepository.java +1 −1 Original line number Diff line number Diff line Loading @@ -19,5 +19,5 @@ package org.apache.shardingsphere.example.common.repository; import org.apache.shardingsphere.example.common.entity.OrderItem; public interface OrderItemRepository extends CommonRepository<OrderItem> { public interface OrderItemRepository extends CommonRepository<OrderItem, Long> { } example-common/repository-api/src/main/java/org/apache/shardingsphere/example/common/repository/OrderRepository.java +1 −1 Original line number Diff line number Diff line Loading @@ -19,5 +19,5 @@ package org.apache.shardingsphere.example.common.repository; import org.apache.shardingsphere.example.common.entity.Order; public interface OrderRepository extends CommonRepository<Order> { public interface OrderRepository extends CommonRepository<Order, Long> { } example-common/repository-api/src/main/java/org/apache/shardingsphere/example/common/repository/UserRepository.java +1 −1 Original line number Diff line number Diff line Loading @@ -19,5 +19,5 @@ package org.apache.shardingsphere.example.common.repository; import org.apache.shardingsphere.example.common.entity.User; public interface UserRepository extends CommonRepository<User> { public interface UserRepository extends CommonRepository<User, Long> { } Loading
example-common/repository-api/src/main/java/org/apache/shardingsphere/example/common/repository/CommonRepository.java +25 −3 Original line number Diff line number Diff line Loading @@ -19,17 +19,39 @@ package org.apache.shardingsphere.example.common.repository; import java.util.List; public interface CommonRepository<T> { public interface CommonRepository<T, P> { /** * Create table if not exist. */ void createTableIfNotExists(); /** * Drop table. */ void dropTable(); /** * Truncate table. */ void truncateTable(); Long insert(T entity); /** * insert one entity. * @param entity entity * @return primary key */ P insert(T entity); void delete(Long id); /** * Do delete. * @param key key */ void delete(P key); /** * select all. * @return list of entity */ List<T> selectAll(); }
example-common/repository-api/src/main/java/org/apache/shardingsphere/example/common/repository/OrderItemRepository.java +1 −1 Original line number Diff line number Diff line Loading @@ -19,5 +19,5 @@ package org.apache.shardingsphere.example.common.repository; import org.apache.shardingsphere.example.common.entity.OrderItem; public interface OrderItemRepository extends CommonRepository<OrderItem> { public interface OrderItemRepository extends CommonRepository<OrderItem, Long> { }
example-common/repository-api/src/main/java/org/apache/shardingsphere/example/common/repository/OrderRepository.java +1 −1 Original line number Diff line number Diff line Loading @@ -19,5 +19,5 @@ package org.apache.shardingsphere.example.common.repository; import org.apache.shardingsphere.example.common.entity.Order; public interface OrderRepository extends CommonRepository<Order> { public interface OrderRepository extends CommonRepository<Order, Long> { }
example-common/repository-api/src/main/java/org/apache/shardingsphere/example/common/repository/UserRepository.java +1 −1 Original line number Diff line number Diff line Loading @@ -19,5 +19,5 @@ package org.apache.shardingsphere.example.common.repository; import org.apache.shardingsphere.example.common.entity.User; public interface UserRepository extends CommonRepository<User> { public interface UserRepository extends CommonRepository<User, Long> { }