org.teiid.metadata.Table.getInsertPlan()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(245)

本文整理了Java中org.teiid.metadata.Table.getInsertPlan()方法的一些代码示例,展示了Table.getInsertPlan()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getInsertPlan()方法的具体详情如下:
包路径:org.teiid.metadata.Table
类名称:Table
方法名:getInsertPlan

Table.getInsertPlan介绍

暂无

代码示例

代码示例来源:origin: org.jboss.teiid/teiid-engine

  1. private static String getPlanForEvent(Table t, TriggerEvent event) {
  2. switch (event) {
  3. case DELETE:
  4. return t.getDeletePlan();
  5. case INSERT:
  6. return t.getInsertPlan();
  7. case UPDATE:
  8. return t.getUpdatePlan();
  9. }
  10. throw new AssertionError();
  11. }

代码示例来源:origin: org.teiid/teiid-engine

  1. private static String getPlanForEvent(Table t, TriggerEvent event) {
  2. switch (event) {
  3. case DELETE:
  4. return t.getDeletePlan();
  5. case INSERT:
  6. return t.getInsertPlan();
  7. case UPDATE:
  8. return t.getUpdatePlan();
  9. }
  10. throw new AssertionError();
  11. }

代码示例来源:origin: teiid/teiid

  1. private static String getPlanForEvent(Table t, TriggerEvent event) {
  2. switch (event) {
  3. case DELETE:
  4. return t.getDeletePlan();
  5. case INSERT:
  6. return t.getInsertPlan();
  7. case UPDATE:
  8. return t.getUpdatePlan();
  9. }
  10. throw new AssertionError();
  11. }

代码示例来源:origin: org.jboss.teiid/teiid-engine

  1. public String getInsertPlan(final Object groupID) throws TeiidComponentException, QueryMetadataException {
  2. Table tableRecordImpl = (Table)groupID;
  3. if (!tableRecordImpl.isVirtual()) {
  4. throw new QueryMetadataException(QueryPlugin.Event.TEIID30359, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30359, tableRecordImpl.getFullName(), "Insert")); //$NON-NLS-1$
  5. }
  6. return tableRecordImpl.isInsertPlanEnabled()?tableRecordImpl.getInsertPlan():null;
  7. }

代码示例来源:origin: org.teiid/teiid-engine

  1. public String getInsertPlan(final Object groupID) throws TeiidComponentException, QueryMetadataException {
  2. Table tableRecordImpl = (Table)groupID;
  3. if (!tableRecordImpl.isVirtual()) {
  4. throw new QueryMetadataException(QueryPlugin.Event.TEIID30359, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30359, tableRecordImpl.getFullName(), "Insert")); //$NON-NLS-1$
  5. }
  6. return tableRecordImpl.isInsertPlanEnabled()?tableRecordImpl.getInsertPlan():null;
  7. }

代码示例来源:origin: teiid/teiid

  1. public String getInsertPlan(final Object groupID) throws TeiidComponentException, QueryMetadataException {
  2. Table tableRecordImpl = (Table)groupID;
  3. if (!tableRecordImpl.isVirtual()) {
  4. throw new QueryMetadataException(QueryPlugin.Event.TEIID30359, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30359, tableRecordImpl.getFullName(), "Insert")); //$NON-NLS-1$
  5. }
  6. return tableRecordImpl.isInsertPlanEnabled()?tableRecordImpl.getInsertPlan():null;
  7. }

代码示例来源:origin: teiid/teiid

  1. @Test
  2. public void testInsteadOfTrigger() throws Exception {
  3. String ddl = "CREATE VIEW G1( e1 integer, e2 varchar) AS select * from foo;" +
  4. "CREATE TRIGGER ON G1 INSTEAD OF INSERT AS " +
  5. "FOR EACH ROW \n" +
  6. "BEGIN ATOMIC \n" +
  7. "insert into g1 (e1, e2) values (1, 'trig');\n" +
  8. "END;" +
  9. "CREATE View G2( e1 integer, e2 varchar) AS select * from foo;";
  10. Schema s = helpParse(ddl, "model").getSchema();
  11. Map<String, Table> tableMap = s.getTables();
  12. assertTrue("Table not found", tableMap.containsKey("G1"));
  13. assertTrue("Table not found", tableMap.containsKey("G2"));
  14. assertEquals("FOR EACH ROW\nBEGIN ATOMIC\nINSERT INTO g1 (e1, e2) VALUES (1, 'trig');\nEND", s.getTable("G1").getInsertPlan());
  15. }

代码示例来源:origin: org.teiid/teiid-spring-boot-starter

  1. @Test
  2. public void testRedirectionLayerInsertPlan() {
  3. RedirectionSchemaBuilder mg = new RedirectionSchemaBuilder(this.context, "redirected");
  4. VDBMetaData vdb = new VDBMetaData();
  5. vdb.addModel(buildSourceTable());
  6. ModelMetaData model = mg.buildRedirectionLayer(buildSourceTableWithPK().getAttachment(MetadataFactory.class),
  7. "base");
  8. String expected = "FOR EACH ROW\n" + "BEGIN ATOMIC\n"
  9. + " DECLARE boolean VARIABLES.Person_PK_EXISTS = (SELECT true FROM source.Person WHERE id = NEW.id);\n"
  10. + " IF (VARIABLES.Person_PK_EXISTS)\n" + " BEGIN\n"
  11. + " RAISE SQLEXCEPTION 'duplicate key';\n" + " END\n" + " ELSE\n" + " BEGIN\n"
  12. + " INSERT INTO redirected.Person_REDIRECTED (id, name, dob, ROW__STATUS) VALUES (NEW.id, NEW.name, NEW.dob, 1);\n"
  13. + " END\n" + "END";
  14. MetadataFactory mf = model.getAttachment(MetadataFactory.class);
  15. Table table = mf.getSchema().getTable("Person");
  16. assertEquals(expected, table.getInsertPlan().replace("\t", " "));
  17. }

代码示例来源:origin: org.jboss.teiid/teiid-engine

  1. buildTrigger(name, null, INSERT, table.getInsertPlan(), false);

代码示例来源:origin: org.teiid/teiid-engine

  1. if (t.getInsertPlan() != null && t.isInsertPlanEnabled()) {
  2. validateUpdatePlan(model, report, metadata, t, t.getInsertPlan(), Command.TYPE_INSERT);

代码示例来源:origin: teiid/teiid

  1. if (t.getInsertPlan() != null && t.isInsertPlanEnabled()) {
  2. validateUpdatePlan(model, report, metadata, t, t.getInsertPlan(), Command.TYPE_INSERT);

代码示例来源:origin: org.jboss.teiid/teiid-engine

  1. if (t.getInsertPlan() != null && t.isInsertPlanEnabled()) {
  2. validateUpdatePlan(model, report, metadata, t, t.getInsertPlan(), Command.TYPE_INSERT);

代码示例来源:origin: teiid/teiid

  1. buildTrigger(name, null, INSERT, table.getInsertPlan(), false);

代码示例来源:origin: org.teiid/teiid-engine

  1. buildTrigger(name, null, INSERT, table.getInsertPlan(), false);

相关文章