Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dao Get Call based on type #15429

Merged
merged 2 commits into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -579,4 +579,8 @@ public static SearchIndex buildSearchIndex(String entityType, Object entity) {
}
throw new BadRequestException("searchrepository not initialized");
}

public static <T> T getDao() {
return (T) collectionDAO;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ public class OpenMetadataApplication extends Application<OpenMetadataApplication
private Authorizer authorizer;
private AuthenticatorHandler authenticatorHandler;

protected Jdbi jdbi;

@Override
public void run(OpenMetadataApplicationConfig catalogConfig, Environment environment)
throws ClassNotFoundException,
Expand All @@ -143,7 +145,7 @@ public void run(OpenMetadataApplicationConfig catalogConfig, Environment environ
// init for dataSourceFactory
DatasourceConfig.initialize(catalogConfig.getDataSourceFactory().getDriverClass());

final Jdbi jdbi = createAndSetupJDBI(environment, catalogConfig.getDataSourceFactory());
jdbi = createAndSetupJDBI(environment, catalogConfig.getDataSourceFactory());
CollectionDAO collectionDAO = jdbi.onDemand(CollectionDAO.class);
Entity.setCollectionDAO(collectionDAO);

Expand Down
Loading