Getting StoreProcedures name from databaseTools in 2021.1 API
Answered
I've being using Intellij 17 till now & with the lastest update to 2021.1 I needed
to change the code -
DatabaseSystem databaseSystem = getDataSource();
JBIterable<String> jbIterable = databaseSystem.getModel().traverser()
.expand(dasObject -> dasObject instanceof DbPackage || dasObject instanceof DasNamespace)
.filter(SybaseProcedureGroup.class)
.map(BasicNamedElement::getName);
spNamesMap = jbIterable.toSet().stream().collect(Collectors.toMap(o -> o, o -> o));
return jbIterable.toSet();
I tried changing the code to -
DasDataSource databaseSystem = getDataSource();
JBIterable<String> jbIterable = databaseSystem.getModel().traverser()
.expand(dasObject -> dasObject instanceof DbPackage || dasObject instanceof DasNamespace)
.filter(AseProcedureGroup.class)
.map(aseProcedureGroup -> aseProcedureGroup.getProcedures()) // here's the problem
spNamesMap = jbIterable.toSet().stream().collect(Collectors.toMap(o -> o, o -> o));
return jbIterable.toSet();
With the line marked I have a problem, what's the proper way to get the name in the new API?
Please sign in to leave a comment.
In first snippet you were collecting procedure group names:
So I think in new one you should collect them too:
But I suggest you not to use any class that inherits `Basic***` they are generated and we won't keep them compatible in any way.
You'd better to stick to `Das*` interfaces && ObjectKind:
Thank you for the fast reply, it seems to compile fine, still trying to get a valid runtime test