diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/entities/ids/ManyToOneNotAuditedEmbId.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/entities/ids/ManyToOneNotAuditedEmbId.java index 91c061a52a..68e2581740 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/entities/ids/ManyToOneNotAuditedEmbId.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/entities/ids/ManyToOneNotAuditedEmbId.java @@ -10,7 +10,7 @@ import org.hibernate.envers.test.entities.UnversionedStrTestEntity; */ @Embeddable public class ManyToOneNotAuditedEmbId implements Serializable { - @ManyToOne + @ManyToOne(optional = false) private UnversionedStrTestEntity id; public ManyToOneNotAuditedEmbId() { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/modifiedflags/entities/PartialModifiedFlagsEntity.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/modifiedflags/entities/PartialModifiedFlagsEntity.java index fd87732b1d..d06d16e5af 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/modifiedflags/entities/PartialModifiedFlagsEntity.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/modifiedflags/entities/PartialModifiedFlagsEntity.java @@ -93,7 +93,8 @@ public class PartialModifiedFlagsEntity { @Audited(withModifiedFlag = true) @ManyToMany - @CollectionTable(name = "ENTITIESMAP") + @CollectionTable(name = "ENTITIESMAP") + @MapKeyColumn(nullable = false) private Map entitiesMap = new HashMap(); diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/strategy/ValidityAuditStrategyRevEndTestCustomRevEnt.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/strategy/ValidityAuditStrategyRevEndTestCustomRevEnt.java index 46bfc5ed68..7375170d27 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/strategy/ValidityAuditStrategyRevEndTestCustomRevEnt.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/strategy/ValidityAuditStrategyRevEndTestCustomRevEnt.java @@ -39,6 +39,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.dialect.PostgreSQL82Dialect; import org.hibernate.dialect.SQLServerDialect; +import org.hibernate.dialect.SybaseASE15Dialect; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.strategy.ValidityAuditStrategy; import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; @@ -101,7 +102,7 @@ public class ValidityAuditStrategyRevEndTestCustomRevEnt extends BaseEnversJPAFu .createSQLQuery( "CREATE TABLE children_AUD(REV integer NOT NULL, REVEND integer, " + revendTimestampColumName + " " - + (getDialect() instanceof SQLServerDialect ? "datetime" : "timestamp") + + ((getDialect() instanceof SQLServerDialect || getDialect() instanceof SybaseASE15Dialect) ? "datetime" : "timestamp") + ", REVTYPE " + (getDialect() instanceof Oracle8iDialect ? "number(3,0)" : (getDialect() instanceof PostgreSQL82Dialect ? "smallint" : "tinyint")) + ", parent_id integer, child1_id integer NULL, child2_id integer NULL)") diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/strategy/ValidityAuditStrategyRevEndTsTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/strategy/ValidityAuditStrategyRevEndTsTest.java index 994d9d5806..b9fc1e031a 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/strategy/ValidityAuditStrategyRevEndTsTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/strategy/ValidityAuditStrategyRevEndTsTest.java @@ -40,6 +40,7 @@ import org.hibernate.Session; import org.hibernate.dialect.MySQL5Dialect; import org.hibernate.dialect.PostgreSQL82Dialect; import org.hibernate.dialect.SQLServerDialect; +import org.hibernate.dialect.SybaseASE15Dialect; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.enhanced.SequenceIdRevisionEntity; import org.hibernate.envers.strategy.ValidityAuditStrategy; @@ -102,7 +103,7 @@ public class ValidityAuditStrategyRevEndTsTest extends BaseEnversJPAFunctionalTe .createSQLQuery( "CREATE TABLE children_AUD(REV integer NOT NULL, REVEND integer, " + revendTimestampColumName + " " - + (getDialect() instanceof SQLServerDialect ? "datetime" : "timestamp") + + ((getDialect() instanceof SQLServerDialect || getDialect() instanceof SybaseASE15Dialect ) ? "datetime" : "timestamp") + ", REVTYPE " + (getDialect() instanceof Oracle8iDialect ? "number(3,0)" : (getDialect() instanceof PostgreSQL82Dialect ? "smallint" : "tinyint")) + ", parent_id integer, child1_id integer NULL, child2_id integer NULL)") @@ -431,6 +432,11 @@ public class ValidityAuditStrategyRevEndTsTest extends BaseEnversJPAFunctionalTe if (getDialect() instanceof MySQL5Dialect) { // MySQL5 DATETIME column type does not contain milliseconds. Assert.assertEquals(revendTimestamp.getTime(), (revEnd.getTimestamp() - (revEnd.getTimestamp() % 1000))); + } else if (getDialect() instanceof SybaseASE15Dialect) { + // Sybase "DATETIME values are accurate to 1/300 second on platforms that support this level of granularity". + Assert.assertEquals( + revendTimestamp.getTime() / 1000.0, revEnd.getTimestamp() / 1000.0, 1.0 / 300.0 + ); } else { Assert.assertEquals(revendTimestamp.getTime(), revEnd.getTimestamp()); }