From bdab36f6f25cd9ec934e4bdfbf633edd3aea9bcb Mon Sep 17 00:00:00 2001 From: Strong Liu Date: Thu, 16 Sep 2010 11:00:16 +0000 Subject: [PATCH] HHH-5572 clean up Sybase job failures git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@20650 1b8cb986-b30d-0410-93ca-fae66ebed9b2 --- parent/pom.xml | 4 ++-- .../org/hibernate/test/annotations/any/PropertyMap.java | 2 +- .../test/java/org/hibernate/test/annotations/cid/AId.java | 4 ++-- .../java/org/hibernate/test/annotations/cid/ChildPk.java | 4 ++-- .../java/org/hibernate/test/annotations/cid/TvMagazin.java | 5 ++++- .../org/hibernate/test/annotations/cid/TvMagazinPk.java | 4 ++++ .../java/org/hibernate/test/annotations/cid/TvProgram.java | 7 +++++++ .../hibernate/test/annotations/cid/TvProgramIdClass.java | 3 +++ .../hibernate/test/annotations/cid/keymanytoone/Key.java | 2 ++ .../hibernate/test/annotations/collectionelement/Boy.java | 4 ++++ .../test/annotations/collectionelement/Matrix.java | 2 ++ .../test/annotations/derivedidentities/e1/a/Dependent.java | 2 ++ .../test/annotations/derivedidentities/e1/b/Dependent.java | 1 + .../derivedidentities/e1/b/ExclusiveDependent.java | 2 +- .../hibernate/test/annotations/indexcoll/Atmosphere.java | 3 +++ 15 files changed, 40 insertions(+), 9 deletions(-) diff --git a/parent/pom.xml b/parent/pom.xml index 78c8a7df87..ae496617d7 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -916,7 +916,7 @@ org.hibernate.dialect.SybaseASE15Dialect com.sybase.jdbc3.jdbc.SybDriver - jdbc:sybase:Tds:vmg07.mw.lab.eng.bos.redhat.com:5000/hibbrtru?DYNAMIC_PREPARE=true + jdbc:sybase:Tds:vmg07.mw.lab.eng.bos.redhat.com:5000/hibbrtru?SQLINITSTRING=set quoted_identifier on hibbrtru hibbrtru @@ -935,7 +935,7 @@ org.hibernate.dialect.SybaseASE15Dialect com.sybase.jdbc3.jdbc.SybDriver - jdbc:sybase:Tds:vmg09.mw.lab.eng.bos.redhat.com:5000/hibbrtru?DYNAMIC_PREPARE=true + jdbc:sybase:Tds:vmg09.mw.lab.eng.bos.redhat.com:5000/hibbrtru?SQLINITSTRING=set quoted_identifier on hibbrtru hibbrtru diff --git a/testsuite/src/test/java/org/hibernate/test/annotations/any/PropertyMap.java b/testsuite/src/test/java/org/hibernate/test/annotations/any/PropertyMap.java index c1993862eb..a55517d186 100644 --- a/testsuite/src/test/java/org/hibernate/test/annotations/any/PropertyMap.java +++ b/testsuite/src/test/java/org/hibernate/test/annotations/any/PropertyMap.java @@ -61,7 +61,7 @@ public class PropertyMap { name = "map_properties", joinColumns = @JoinColumn( name = "map_id" ), inverseJoinColumns = @JoinColumn( name = "property_id" ) ) - @MapKey( columns = { @Column( name = "map_key" ) } ) //keep for legacy test + @MapKey( columns = { @Column( name = "map_key", nullable = false ) } ) //keep for legacy test public Map getProperties() { return properties; } diff --git a/testsuite/src/test/java/org/hibernate/test/annotations/cid/AId.java b/testsuite/src/test/java/org/hibernate/test/annotations/cid/AId.java index a0c014386c..b21a8f74c3 100644 --- a/testsuite/src/test/java/org/hibernate/test/annotations/cid/AId.java +++ b/testsuite/src/test/java/org/hibernate/test/annotations/cid/AId.java @@ -14,11 +14,11 @@ import javax.persistence.OneToOne; public class AId implements Serializable { @OneToOne - @JoinColumn( name = "bid" ) + @JoinColumn( name = "bid", nullable = false ) private B b; @OneToOne - @JoinColumn( name = "cid" ) + @JoinColumn( name = "cid", nullable = false ) private C c; diff --git a/testsuite/src/test/java/org/hibernate/test/annotations/cid/ChildPk.java b/testsuite/src/test/java/org/hibernate/test/annotations/cid/ChildPk.java index cdec60ffac..01f8b4fcc4 100644 --- a/testsuite/src/test/java/org/hibernate/test/annotations/cid/ChildPk.java +++ b/testsuite/src/test/java/org/hibernate/test/annotations/cid/ChildPk.java @@ -17,8 +17,8 @@ public class ChildPk implements Serializable { public int nthChild; @ManyToOne() @JoinColumns({ - @JoinColumn(name = "parentLastName", referencedColumnName = "p_lname"), - @JoinColumn(name = "parentFirstName", referencedColumnName = "firstName") + @JoinColumn(name = "parentLastName", referencedColumnName = "p_lname", nullable = false), + @JoinColumn(name = "parentFirstName", referencedColumnName = "firstName", nullable = false) }) public Parent parent; diff --git a/testsuite/src/test/java/org/hibernate/test/annotations/cid/TvMagazin.java b/testsuite/src/test/java/org/hibernate/test/annotations/cid/TvMagazin.java index fed927dde4..743e3b8a26 100644 --- a/testsuite/src/test/java/org/hibernate/test/annotations/cid/TvMagazin.java +++ b/testsuite/src/test/java/org/hibernate/test/annotations/cid/TvMagazin.java @@ -3,6 +3,7 @@ package org.hibernate.test.annotations.cid; import java.util.Date; import javax.persistence.AssociationOverride; +import javax.persistence.AssociationOverrides; import javax.persistence.EmbeddedId; import javax.persistence.Entity; import javax.persistence.JoinColumn; @@ -13,7 +14,9 @@ import javax.persistence.TemporalType; * @author Emmanuel Bernard */ @Entity -@AssociationOverride(name = "id.channel", joinColumns = @JoinColumn(name = "chan_id")) +@AssociationOverrides({ +@AssociationOverride(name = "id.channel", joinColumns = @JoinColumn(name = "chan_id", nullable = false)), +@AssociationOverride(name = "id.presenter", joinColumns = @JoinColumn(name = "presenter_name", nullable = false))}) public class TvMagazin { @EmbeddedId public TvMagazinPk id; diff --git a/testsuite/src/test/java/org/hibernate/test/annotations/cid/TvMagazinPk.java b/testsuite/src/test/java/org/hibernate/test/annotations/cid/TvMagazinPk.java index 4cce95f482..b4e00f97bc 100644 --- a/testsuite/src/test/java/org/hibernate/test/annotations/cid/TvMagazinPk.java +++ b/testsuite/src/test/java/org/hibernate/test/annotations/cid/TvMagazinPk.java @@ -2,7 +2,9 @@ package org.hibernate.test.annotations.cid; import java.io.Serializable; + import javax.persistence.Embeddable; +import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; /** @@ -11,8 +13,10 @@ import javax.persistence.ManyToOne; @Embeddable public class TvMagazinPk implements Serializable { @ManyToOne + @JoinColumn(nullable=false) public Channel channel; @ManyToOne + @JoinColumn(nullable=false) public Presenter presenter; } diff --git a/testsuite/src/test/java/org/hibernate/test/annotations/cid/TvProgram.java b/testsuite/src/test/java/org/hibernate/test/annotations/cid/TvProgram.java index b48920f223..dbe39b52f9 100644 --- a/testsuite/src/test/java/org/hibernate/test/annotations/cid/TvProgram.java +++ b/testsuite/src/test/java/org/hibernate/test/annotations/cid/TvProgram.java @@ -2,9 +2,13 @@ package org.hibernate.test.annotations.cid; import java.util.Date; + +import javax.persistence.AssociationOverride; +import javax.persistence.AssociationOverrides; import javax.persistence.Column; import javax.persistence.EmbeddedId; import javax.persistence.Entity; +import javax.persistence.JoinColumn; import javax.persistence.PrimaryKeyJoinColumn; import javax.persistence.SecondaryTable; import javax.persistence.Temporal; @@ -18,6 +22,9 @@ import javax.persistence.TemporalType; @PrimaryKeyJoinColumn( name = "CHANNEL_ID" ), @PrimaryKeyJoinColumn( name = "PRESENTER_NAME" ) } ) +@AssociationOverrides({ +@AssociationOverride(name = "id.channel", joinColumns = @JoinColumn(name = "chan_id", nullable = false)), +@AssociationOverride(name = "id.presenter", joinColumns = @JoinColumn(name = "presenter_name", nullable = false))}) public class TvProgram { @EmbeddedId public TvMagazinPk id; diff --git a/testsuite/src/test/java/org/hibernate/test/annotations/cid/TvProgramIdClass.java b/testsuite/src/test/java/org/hibernate/test/annotations/cid/TvProgramIdClass.java index 69411b77f0..c83ee762f3 100644 --- a/testsuite/src/test/java/org/hibernate/test/annotations/cid/TvProgramIdClass.java +++ b/testsuite/src/test/java/org/hibernate/test/annotations/cid/TvProgramIdClass.java @@ -6,6 +6,7 @@ import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.IdClass; +import javax.persistence.JoinColumn; import javax.persistence.PrimaryKeyJoinColumn; import javax.persistence.SecondaryTable; import javax.persistence.Temporal; @@ -20,8 +21,10 @@ import javax.persistence.TemporalType; @IdClass( TvMagazinPk.class ) public class TvProgramIdClass { @Id + @JoinColumn(nullable=false) public Channel channel; @Id + @JoinColumn(nullable=false) public Presenter presenter; @Temporal( TemporalType.TIME ) diff --git a/testsuite/src/test/java/org/hibernate/test/annotations/cid/keymanytoone/Key.java b/testsuite/src/test/java/org/hibernate/test/annotations/cid/keymanytoone/Key.java index d247582adb..3a8fdea138 100644 --- a/testsuite/src/test/java/org/hibernate/test/annotations/cid/keymanytoone/Key.java +++ b/testsuite/src/test/java/org/hibernate/test/annotations/cid/keymanytoone/Key.java @@ -26,6 +26,7 @@ package org.hibernate.test.annotations.cid.keymanytoone; import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.Id; +import javax.persistence.Table; /** * TODO : javadoc @@ -33,6 +34,7 @@ import javax.persistence.Id; * @author Steve Ebersole */ @Entity +@Table(name="`key`") public class Key implements Serializable { @Id private String id; diff --git a/testsuite/src/test/java/org/hibernate/test/annotations/collectionelement/Boy.java b/testsuite/src/test/java/org/hibernate/test/annotations/collectionelement/Boy.java index d96bcb1542..fc4879c677 100644 --- a/testsuite/src/test/java/org/hibernate/test/annotations/collectionelement/Boy.java +++ b/testsuite/src/test/java/org/hibernate/test/annotations/collectionelement/Boy.java @@ -17,6 +17,7 @@ import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; +import javax.persistence.MapKeyColumn; import javax.persistence.OrderColumn; import javax.persistence.Table; @@ -102,6 +103,7 @@ public class Boy { } @ElementCollection + @MapKeyColumn(nullable=false) public Map getScorePerPreferredName() { return scorePerPreferredName; } @@ -113,6 +115,7 @@ public class Boy { @ElementCollection @CollectionTable(name = "ScorePerNickName", joinColumns = @JoinColumn(name = "BoyId")) @Column(name = "score", nullable = false) + @MapKeyColumn(nullable=false) public Map getScorePerNickName() { return scorePerNickName; } @@ -158,6 +161,7 @@ public class Boy { @ElementCollection @Enumerated(EnumType.STRING) + @MapKeyColumn(nullable=false) public Map getFavoriteFood() { return foods; } diff --git a/testsuite/src/test/java/org/hibernate/test/annotations/collectionelement/Matrix.java b/testsuite/src/test/java/org/hibernate/test/annotations/collectionelement/Matrix.java index 95c0a5fcfd..c0ece28a0f 100644 --- a/testsuite/src/test/java/org/hibernate/test/annotations/collectionelement/Matrix.java +++ b/testsuite/src/test/java/org/hibernate/test/annotations/collectionelement/Matrix.java @@ -8,6 +8,7 @@ import javax.persistence.ElementCollection; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.MapKeyColumn; import org.hibernate.annotations.MapKeyType; import org.hibernate.annotations.Sort; @@ -27,6 +28,7 @@ public class Matrix { @ElementCollection @Sort(type = SortType.NATURAL) @Type(type = "float") + @MapKeyColumn(nullable = false) private SortedMap mvalues = new TreeMap(); public Integer getId() { diff --git a/testsuite/src/test/java/org/hibernate/test/annotations/derivedidentities/e1/a/Dependent.java b/testsuite/src/test/java/org/hibernate/test/annotations/derivedidentities/e1/a/Dependent.java index b8c0af855f..0a06c50372 100644 --- a/testsuite/src/test/java/org/hibernate/test/annotations/derivedidentities/e1/a/Dependent.java +++ b/testsuite/src/test/java/org/hibernate/test/annotations/derivedidentities/e1/a/Dependent.java @@ -4,6 +4,7 @@ import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.IdClass; +import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import org.hibernate.annotations.Cascade; @@ -39,6 +40,7 @@ public class Dependent { @Id @ManyToOne( cascade = CascadeType.PERSIST ) @Cascade( org.hibernate.annotations.CascadeType.SAVE_UPDATE ) + @JoinColumn(nullable=false) public Employee getEmp() { return emp; } diff --git a/testsuite/src/test/java/org/hibernate/test/annotations/derivedidentities/e1/b/Dependent.java b/testsuite/src/test/java/org/hibernate/test/annotations/derivedidentities/e1/b/Dependent.java index be73707338..2569e69733 100644 --- a/testsuite/src/test/java/org/hibernate/test/annotations/derivedidentities/e1/b/Dependent.java +++ b/testsuite/src/test/java/org/hibernate/test/annotations/derivedidentities/e1/b/Dependent.java @@ -17,6 +17,7 @@ public class Dependent { //@JoinColumn(name="FK") // id attribute mapped by join column default @MapsId("empPK") // maps empPK attribute of embedded id @ManyToOne + @JoinColumn(nullable=false) Employee emp; } diff --git a/testsuite/src/test/java/org/hibernate/test/annotations/derivedidentities/e1/b/ExclusiveDependent.java b/testsuite/src/test/java/org/hibernate/test/annotations/derivedidentities/e1/b/ExclusiveDependent.java index ad01f92f65..9efbf3fe60 100644 --- a/testsuite/src/test/java/org/hibernate/test/annotations/derivedidentities/e1/b/ExclusiveDependent.java +++ b/testsuite/src/test/java/org/hibernate/test/annotations/derivedidentities/e1/b/ExclusiveDependent.java @@ -14,7 +14,7 @@ public class ExclusiveDependent { @EmbeddedId DependentId id; - @JoinColumn(name = "FK") + @JoinColumn(name = "FK", nullable = false) // id attribute mapped by join column default @MapsId("empPK") // maps empPK attribute of embedded id diff --git a/testsuite/src/test/java/org/hibernate/test/annotations/indexcoll/Atmosphere.java b/testsuite/src/test/java/org/hibernate/test/annotations/indexcoll/Atmosphere.java index d147d7b7f0..92a9ab7d11 100644 --- a/testsuite/src/test/java/org/hibernate/test/annotations/indexcoll/Atmosphere.java +++ b/testsuite/src/test/java/org/hibernate/test/annotations/indexcoll/Atmosphere.java @@ -44,10 +44,12 @@ public class Atmosphere { @MapKeyTemporal(TemporalType.DATE) @ElementCollection + @MapKeyColumn(nullable=false) public Map colorPerDate = new HashMap(); @ElementCollection @MapKeyEnumerated(EnumType.STRING) + @MapKeyColumn(nullable=false) public Map colorPerLevel = new HashMap(); @ManyToMany(cascade = CascadeType.ALL) @@ -71,6 +73,7 @@ public class Atmosphere { @ManyToMany(cascade = CascadeType.ALL) @MapKey @JoinTable(name="Atm_Gas_DefLeg") + @MapKeyColumn(nullable=false) public Map gasesDefLeg = new HashMap(); @ManyToMany(cascade = CascadeType.ALL)