本文整理了Java中org.teiid.metadata.Procedure.getResultSet()
方法的一些代码示例,展示了Procedure.getResultSet()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Procedure.getResultSet()
方法的具体详情如下:
包路径:org.teiid.metadata.Procedure
类名称:Procedure
方法名:getResultSet
暂无
代码示例来源:origin: org.teiid/teiid-olingo
private boolean hasResultSet() {
return this.procedure.getResultSet() != null;
}
代码示例来源:origin: org.jboss.teiid/teiid-engine
@Override
protected Collection<? extends BaseColumn> getChildren(final Procedure parent, CommandContext cc) {
Collection<ProcedureParameter> params = parent.getParameters();
if (parent.getResultSet() == null) {
return params;
}
//TODO: don't incur the gc cost of the temp list
Collection<Column> rsColumns = parent.getResultSet().getColumns();
ArrayList<BaseColumn> result = new ArrayList<BaseColumn>(params.size() + rsColumns.size());
result.addAll(params);
result.addAll(rsColumns);
return result;
}
代码示例来源:origin: teiid/teiid
@Override
protected Collection<? extends BaseColumn> getChildren(final Procedure parent, CommandContext cc) {
Collection<ProcedureParameter> params = parent.getParameters();
if (parent.getResultSet() == null) {
return params;
}
//TODO: don't incur the gc cost of the temp list
Collection<Column> rsColumns = parent.getResultSet().getColumns();
ArrayList<BaseColumn> result = new ArrayList<BaseColumn>(params.size() + rsColumns.size());
result.addAll(params);
result.addAll(rsColumns);
return result;
}
代码示例来源:origin: org.teiid/teiid-engine
@Override
protected Collection<? extends BaseColumn> getChildren(final Procedure parent, CommandContext cc) {
Collection<ProcedureParameter> params = parent.getParameters();
if (parent.getResultSet() == null) {
return params;
}
//TODO: don't incur the gc cost of the temp list
Collection<Column> rsColumns = parent.getResultSet().getColumns();
ArrayList<BaseColumn> result = new ArrayList<BaseColumn>(params.size() + rsColumns.size());
result.addAll(params);
result.addAll(rsColumns);
return result;
}
代码示例来源:origin: org.teiid/teiid-olingo
public Column getColumnByName(String name) {
for (final Column column : procedure.getResultSet().getColumns()) {
if (column.getName().equals(name)) {
return column;
}
}
return null;
}
代码示例来源:origin: org.teiid.connectors/translator-swagger
private boolean isMapResponse(Procedure procedure) {
ColumnSet<Procedure> columnSet = procedure.getResultSet();
if (columnSet == null) {
return false;
}
List<Column> columns = columnSet .getColumns();
if (columns.size() >=2 &&
columns.get(0).getName().equals(SwaggerMetadataProcessor.KEY_NAME) &&
columns.get(1).getName().equals(SwaggerMetadataProcessor.KEY_VALUE)) {
return true;
}
return false;
}
代码示例来源:origin: teiid/teiid
/**
* @return the result set types or a zero length array if no result set is returned
*/
public Class<?>[] getResultSetColumnTypes() {
ColumnSet<Procedure> resultSet = this.metadataObject.getResultSet();
if (resultSet == null) {
return new Class[0];
}
List<Column> columnMetadata = resultSet.getColumns();
int size = columnMetadata.size();
Class<?>[] coulmnDTs = new Class[size];
for(int i =0; i<size; i++ ){
coulmnDTs[i] = columnMetadata.get(i).getJavaType();
}
return coulmnDTs;
}
代码示例来源:origin: org.teiid.connectors/translator-odata4
@Override
public List<?> next() throws TranslatorException, DataNotAvailableException {
Procedure procedure = this.command.getMetadataObject();
if (this.response != null) {
Map<String, Object> row = this.response.getNext();
if (row != null) {
return buildRow(procedure.getResultSet(),
procedure.getResultSet().getColumns(),
this.expectedColumnTypes, row);
}
}
return null;
}
代码示例来源:origin: org.teiid/teiid-engine
@Override
public void fillRow(List<Object> row, Procedure proc,
VDBMetaData v, TransformationMetadata metadata,
CommandContext cc, SimpleIterator<Procedure> iter) {
row.add(v.getName());
row.add(proc.getParent().getName());
row.add(proc.getName());
row.add(proc.getNameInSource());
row.add(proc.getResultSet() != null);
row.add(proc.getUUID());
row.add(proc.getAnnotation());
row.add(proc.getParent().getUUID());
}
});
代码示例来源:origin: teiid/teiid
@Override
public void fillRow(List<Object> row, Procedure proc,
VDBMetaData v, TransformationMetadata metadata,
CommandContext cc, SimpleIterator<Procedure> iter) {
row.add(v.getName());
row.add(proc.getParent().getName());
row.add(proc.getName());
row.add(proc.getNameInSource());
row.add(proc.getResultSet() != null);
row.add(proc.getUUID());
row.add(proc.getAnnotation());
row.add(proc.getParent().getUUID());
}
});
代码示例来源:origin: org.jboss.teiid/teiid-engine
@Override
public void fillRow(List<Object> row, Procedure proc,
VDBMetaData v, TransformationMetadata metadata,
CommandContext cc, SimpleIterator<Procedure> iter) {
row.add(v.getName());
row.add(proc.getParent().getName());
row.add(proc.getName());
row.add(proc.getNameInSource());
row.add(proc.getResultSet() != null);
row.add(proc.getUUID());
row.add(proc.getAnnotation());
row.add(proc.getParent().getUUID());
}
});
代码示例来源:origin: org.teiid/teiid-olingo
private static boolean doesProcedureReturn(Procedure proc) {
for (ProcedureParameter pp : proc.getParameters()) {
if (pp.getType().equals(ProcedureParameter.Type.ReturnValue)) {
return true;
}
}
return (proc.getResultSet() != null);
}
代码示例来源:origin: org.jboss.teiid/teiid-engine
AbstractMetadataRecord getColumn(String paramName, Procedure proc, boolean parameter) throws MetadataException {
if (proc.getResultSet() != null) {
Column result = proc.getResultSet().getColumnByName(paramName);
if (result != null) {
return result;
}
}
if (parameter) {
List<ProcedureParameter> params = proc.getParameters();
for (ProcedureParameter param:params) {
if (param.getName().equalsIgnoreCase(paramName)) {
return param;
}
}
}
throw new MetadataException(QueryPlugin.Util.getString("SQLParser.alter_procedure_param_doesnot_exist", paramName, proc.getName())); //$NON-NLS-1$
}
代码示例来源:origin: teiid/teiid
AbstractMetadataRecord getColumn(String paramName, Procedure proc, boolean parameter) throws MetadataException {
if (proc.getResultSet() != null) {
Column result = proc.getResultSet().getColumnByName(paramName);
if (result != null) {
return result;
}
}
if (parameter) {
List<ProcedureParameter> params = proc.getParameters();
for (ProcedureParameter param:params) {
if (param.getName().equalsIgnoreCase(paramName)) {
return param;
}
}
}
throw new MetadataException(QueryPlugin.Util.getString("SQLParser.alter_procedure_param_doesnot_exist", paramName, proc.getName())); //$NON-NLS-1$
}
代码示例来源:origin: org.teiid/teiid-engine
public void visit(CommandStatement obj) {
if (!obj.isReturnable() || obj.getCommand() instanceof DynamicCommand || !obj.getCommand().returnsResultSet()) {
return;
}
for (int i = 0; i < proc.getResultSet().getColumns().size(); i++) {
Column c = proc.getResultSet().getColumns().get(i);
LinkedHashSet<AbstractMetadataRecord> columnValues = null;
if (c.getIncomingObjects() instanceof LinkedHashSet) {
columnValues = (LinkedHashSet<AbstractMetadataRecord>) c.getIncomingObjects();
} else {
columnValues = new LinkedHashSet<>();
c.setIncomingObjects(columnValues);
}
determineDependencies(obj.getCommand(), c, i, columnValues);
}
}
});
代码示例来源:origin: org.jboss.teiid/teiid-engine
public void procedureCreated(Procedure procedure) {
if (!assertInEditMode(Mode.SCHEMA)) {
return;
}
assertGrant(Grant.Permission.Privilege.CREATE, Database.ResourceType.PROCEDURE, procedure);
Schema s = getCurrentSchema();
setUUID(s.getUUID(), procedure);
for (ProcedureParameter param : procedure.getParameters()) {
setUUID(s.getUUID(), param);
}
if (procedure.getResultSet() != null) {
setUUID(s.getUUID(), procedure.getResultSet());
}
s.addProcedure(procedure);
}
代码示例来源:origin: org.teiid/teiid-engine
public void procedureCreated(Procedure procedure) {
if (!assertInEditMode(Mode.SCHEMA)) {
return;
}
assertGrant(Grant.Permission.Privilege.CREATE, Database.ResourceType.PROCEDURE, procedure);
Schema s = getCurrentSchema();
setUUID(s.getUUID(), procedure);
for (ProcedureParameter param : procedure.getParameters()) {
setUUID(s.getUUID(), param);
}
if (procedure.getResultSet() != null) {
setUUID(s.getUUID(), procedure.getResultSet());
}
s.addProcedure(procedure);
}
代码示例来源:origin: teiid/teiid
public void procedureCreated(Procedure procedure) {
if (!assertInEditMode(Mode.SCHEMA)) {
return;
}
assertGrant(Grant.Permission.Privilege.CREATE, Database.ResourceType.PROCEDURE, procedure);
Schema s = getCurrentSchema();
setUUID(s.getUUID(), procedure);
for (ProcedureParameter param : procedure.getParameters()) {
setUUID(s.getUUID(), param);
}
if (procedure.getResultSet() != null) {
setUUID(s.getUUID(), procedure.getResultSet());
}
s.addProcedure(procedure);
}
代码示例来源:origin: org.teiid/teiid-olingo
@Override
protected void addAllColumns(boolean onlyPK) {
for (final Column column : procedure.getResultSet().getColumns()) {
if (column.isSelectable()) {
EdmReturnType returnType = procedureReturn.getReturnType();
EdmComplexType complexType = (EdmComplexType)returnType.getType();
EdmPropertyImpl edmProperty = (EdmPropertyImpl)complexType.getProperty(column.getName());
addProjectedColumn(new ElementSymbol(column.getName(), getGroupSymbol()), edmProperty.getType(), edmProperty, edmProperty.isCollection());
}
}
}
代码示例来源:origin: teiid/teiid
@Test
public void testTypeLength() throws Exception {
String ddl = "CREATE FOREIGN PROCEDURE myProc(OUT p1 boolean, p2 varchar, INOUT p3 decimal) " +
"RETURNS (r1 varchar(10), r2 decimal(11,2), r3 object(1), r4 clob(10000))" +
"OPTIONS(RANDOM 'any', UUID 'uuid', NAMEINSOURCE 'nis', ANNOTATION 'desc', UPDATECOUNT '2');";
Schema s = helpParse(ddl, "model").getSchema();
Procedure proc = s.getProcedure("myProc");
assertNotNull(proc);
List<Column> cols = proc.getResultSet().getColumns();
assertEquals(10, cols.get(0).getLength());
assertEquals(11, cols.get(1).getPrecision());
assertEquals(1, cols.get(2).getLength());
assertEquals(10000, cols.get(3).getLength());
}
内容来源于网络,如有侵权,请联系作者删除!