Skip to content

Commit

Permalink
ydb-platform#32 Support multiple tables under one entity (Review comm…
Browse files Browse the repository at this point in the history
…ents)
  • Loading branch information
Sergei Galiamichev committed Dec 27, 2024
1 parent cd292d0 commit 0ac3435
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,7 @@ public YdbSchemaCompatibilityChecker(List<Class<? extends Entity>> entities, Ydb
}

public YdbSchemaCompatibilityChecker(List<Class<? extends Entity>> entities, YdbRepository repository, Config config) {
this.entities = toDescriptors(entities);
this.config = config;
this.repository = repository;
this.repositoryConfig = this.repository.getConfig();
this(repository, toDescriptors(entities), config);
}

public YdbSchemaCompatibilityChecker(YdbRepository repository, List<TableDescriptor<? extends Entity>> entities, Config config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ protected AbstractDelegatingTable() {

@ExperimentalApi(issue = "https://github.com/ydb-platform/yoj-project/issues/32")
protected AbstractDelegatingTable(@NonNull String tableName) {
this.target = BaseDb.current(BaseDb.class).table(TableDescriptor.from(EntitySchema.of(resolveEntityType()), tableName));
EntitySchema<T> schema = EntitySchema.of(resolveEntityType());
this.target = BaseDb.current(BaseDb.class).table(new TableDescriptor<T>(schema.getType(), tableName));
}

@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ public static <E extends Entity<E>> TableDescriptor<E> from(EntitySchema<E> sche
return new TableDescriptor<>(schema.getType(), schema.getName());
}

public static <E extends Entity<E>> TableDescriptor<E> from(EntitySchema<E> schema, String name) {
return new TableDescriptor<>(schema.getType(), name);
}

public String toDebugString() {
String entityName = entityType.getSimpleName();
if (entityName.equals(tableName)) {
Expand Down

0 comments on commit 0ac3435

Please sign in to comment.