File tree Expand file tree Collapse file tree 2 files changed +13
-12
lines changed
persistence-sharding/src/main/java/org/tus/common/sharding Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change 11package org .tus .common .sharding .entity ;
22
3- import org .tus .common .domain .persistence .SimplePersistedObject ;
3+ import org .tus .common .domain .persistence .PersistedObject ;
44
55/**
66 * Optional base class for entities that participate in sharding.
7- * <p>
8- * This lives in the sharding module and extends the generic SimplePersistedObject
9- * from persistence-common, so persistence-common itself does not depend on sharding.
10- * <p>
7+ *
8+ * Extends PersistedObject so they work with QueryService and ShardingAwareQueryService.
9+ *
1110 * Usage:
1211 * <pre>
13- * ShardedEntity
14- * public class User extends SharedPersistedObject {
15- * @ShardingKey
16- * private String userId;
12+ * @ShardedEntity
13+ * @AttributeOverride(name = "id", column = @Column(name = "id"))
14+ * public class UserCoupon extends ShardedPersistedObject {
15+ * @ShardingKey
16+ * private Long userId;
1717 * }
1818 * </pre>
1919 */
20- public abstract class ShardedPersistedObject extends SimplePersistedObject {
20+ public abstract class ShardedPersistedObject extends PersistedObject {
2121}
22+
Original file line number Diff line number Diff line change 1111
1212/**
1313 * Sharding-aware facade on top of the core QueryService.
14- * <p>
14+ *
1515 * This interface is intentionally small and focused on the most common access patterns:
1616 * - find by id
1717 * - list query
1818 * - paged query
19- * <p>
19+ *
2020 * All operations take a ShardingContext so that callers are forced to think about
2121 * sharding/tenant keys when accessing sharded entities.
2222 */
You can’t perform that action at this time.
0 commit comments