run SelectGeneratorTest on Db2

This commit is contained in:
Gavin 2022-12-19 01:43:32 +01:00 committed by Gavin King
parent ed0f93ecdd
commit 587857e6bf
4 changed files with 38 additions and 2 deletions

View File

@ -52,7 +52,7 @@
<![CDATA[create trigger my_entity_trigger
before insert on my_entity
for each row
set new.id = (select coalesce(max(id), 0) + 1 from my_entity);]]>
set new.id = (select coalesce(max(id), 0) + 1 from my_entity)]]>
</create>
<drop>
<![CDATA[drop trigger if exists my_entity_trigger]]>
@ -61,6 +61,22 @@
<dialect-scope name="org.hibernate.dialect.MariaDBDialect"/>
</database-object>
<database-object>
<create>
<![CDATA[create or replace trigger my_entity_trigger
before insert on my_entity
referencing new as new_entity
for each row
begin
set new_entity.id = (select coalesce(max(id), 0) + 1 from my_entity);
end]]>
</create>
<drop>
<![CDATA[drop trigger my_entity_trigger]]>
</drop>
<dialect-scope name="org.hibernate.dialect.DB2Dialect"/>
</database-object>
<database-object>
<create>
<![CDATA[create or replace trigger my_entity_trigger

View File

@ -11,6 +11,7 @@ import java.io.IOException;
import java.nio.file.Files;
import java.util.EnumSet;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.OracleDialect;
import org.hibernate.dialect.PostgreSQLDialect;
@ -38,6 +39,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
@RequiresDialect(OracleDialect.class)
@RequiresDialect(PostgreSQLDialect.class)
@RequiresDialect(MySQLDialect.class)
@RequiresDialect(DB2Dialect.class)
public class SelectGeneratorTest {
@Test

View File

@ -54,7 +54,7 @@
<![CDATA[create trigger my_entity_trigger
before insert on my_entity
for each row
set new.id = (select coalesce(max(id), 0) + 1 from my_entity);]]>
set new.id = (select coalesce(max(id), 0) + 1 from my_entity)]]>
</create>
<drop>
<![CDATA[drop trigger if exists my_entity_trigger]]>
@ -63,6 +63,22 @@
<dialect-scope name="org.hibernate.dialect.MariaDBDialect"/>
</database-object>
<database-object>
<create>
<![CDATA[create or replace trigger my_entity_trigger
before insert on my_entity
referencing new as new_entity
for each row
begin
set new_entity.id = (select coalesce(max(id), 0) + 1 from my_entity);
end]]>
</create>
<drop>
<![CDATA[drop trigger my_entity_trigger]]>
</drop>
<dialect-scope name="org.hibernate.dialect.DB2Dialect"/>
</database-object>
<database-object>
<create>
<![CDATA[create or replace trigger my_entity_trigger

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.orm.test.generatedkeys.selectannotated;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.OracleDialect;
@ -40,6 +41,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
@RequiresDialect(PostgreSQLDialect.class)
@RequiresDialect(MySQLDialect.class)
@RequiresDialect(H2Dialect.class)
@RequiresDialect(DB2Dialect.class)
public class SelectGeneratorTest {
@Test