make select generator tests run on SQL Server

This commit is contained in:
Gavin 2022-12-19 02:26:09 +01:00 committed by Gavin King
parent 587857e6bf
commit c4e27c0a2e
4 changed files with 36 additions and 0 deletions

View File

@ -61,6 +61,22 @@
<dialect-scope name="org.hibernate.dialect.MariaDBDialect"/>
</database-object>
<database-object>
<create>
<![CDATA[create or alter trigger my_entity_trigger
on my_entity
instead of insert
as
begin
insert into my_entity (id, name) values ( (select coalesce(max(id), 0) + 1 from my_entity), (select name from inserted) );
end]]>
</create>
<drop>
<![CDATA[drop trigger if exists my_entity_trigger]]>
</drop>
<dialect-scope name="org.hibernate.dialect.SQLServerDialect"/>
</database-object>
<database-object>
<create>
<![CDATA[create or replace trigger my_entity_trigger

View File

@ -15,6 +15,7 @@ import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.OracleDialect;
import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.hibernate.tool.schema.TargetType;
@ -40,6 +41,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
@RequiresDialect(PostgreSQLDialect.class)
@RequiresDialect(MySQLDialect.class)
@RequiresDialect(DB2Dialect.class)
@RequiresDialect(SQLServerDialect.class)
public class SelectGeneratorTest {
@Test

View File

@ -63,6 +63,22 @@
<dialect-scope name="org.hibernate.dialect.MariaDBDialect"/>
</database-object>
<database-object>
<create>
<![CDATA[create or alter trigger my_entity_trigger
on my_entity
instead of insert
as
begin
insert into my_entity (id, name) values ( (select coalesce(max(id), 0) + 1 from my_entity), (select name from inserted) );
end]]>
</create>
<drop>
<![CDATA[drop trigger if exists my_entity_trigger]]>
</drop>
<dialect-scope name="org.hibernate.dialect.SQLServerDialect"/>
</database-object>
<database-object>
<create>
<![CDATA[create or replace trigger my_entity_trigger

View File

@ -11,6 +11,7 @@ import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.OracleDialect;
import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.testing.orm.junit.DomainModel;
import org.hibernate.testing.orm.junit.JiraKey;
import org.hibernate.testing.orm.junit.RequiresDialect;
@ -42,6 +43,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
@RequiresDialect(MySQLDialect.class)
@RequiresDialect(H2Dialect.class)
@RequiresDialect(DB2Dialect.class)
@RequiresDialect(SQLServerDialect.class)
public class SelectGeneratorTest {
@Test