Author: stliu
Date: 2010-02-25 02:54:18 -0500 (Thu, 25 Feb 2010)
New Revision: 18880
Modified:
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/any/PropertyMap.java
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/cid/AId.java
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/cid/ChildPk.java
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/cid/TvMagazin.java
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/cid/TvMagazinPk.java
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/collectionelement/Boy.java
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/collectionelement/LocalizedString.java
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/collectionelement/Matrix.java
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/collectionelement/indexedCollection/Sale.java
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/identifiercollection/Passport.java
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/indexcoll/Atmosphere.java
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/target/SizeImpl.java
Log:
JBPAPP-3799 HHH-4773 unit tests fail cos db2 doesn't allow primary key column
nullable
Modified:
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/any/PropertyMap.java
===================================================================
---
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/any/PropertyMap.java 2010-02-25
03:50:02 UTC (rev 18879)
+++
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/any/PropertyMap.java 2010-02-25
07:54:18 UTC (rev 18880)
@@ -61,7 +61,7 @@
name = "map_properties",
joinColumns = @JoinColumn( name = "map_id" ),
inverseJoinColumns = @JoinColumn( name = "property_id" ) )
- @MapKey( columns = { @Column( name = "map_key" ) } )
+ @MapKey( columns = { @Column( name = "map_key",nullable=false ) } )
public Map<String, Property> getProperties() {
return properties;
}
Modified:
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/cid/AId.java
===================================================================
---
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/cid/AId.java 2010-02-25
03:50:02 UTC (rev 18879)
+++
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/cid/AId.java 2010-02-25
07:54:18 UTC (rev 18880)
@@ -14,11 +14,11 @@
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;
Modified:
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/cid/ChildPk.java
===================================================================
---
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/cid/ChildPk.java 2010-02-25
03:50:02 UTC (rev 18879)
+++
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/cid/ChildPk.java 2010-02-25
07:54:18 UTC (rev 18880)
@@ -17,8 +17,8 @@
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;
Modified:
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/cid/TvMagazin.java
===================================================================
---
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/cid/TvMagazin.java 2010-02-25
03:50:02 UTC (rev 18879)
+++
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/cid/TvMagazin.java 2010-02-25
07:54:18 UTC (rev 18880)
@@ -13,7 +13,7 @@
* @author Emmanuel Bernard
*/
@Entity
-@AssociationOverride(name = "id.channel", joinColumns = @JoinColumn(name =
"chan_id"))
+@AssociationOverride(name = "id.channel", joinColumns = @JoinColumn(name =
"chan_id",nullable=false))
public class TvMagazin {
@EmbeddedId
public TvMagazinPk id;
Modified:
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/cid/TvMagazinPk.java
===================================================================
---
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/cid/TvMagazinPk.java 2010-02-25
03:50:02 UTC (rev 18879)
+++
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/cid/TvMagazinPk.java 2010-02-25
07:54:18 UTC (rev 18880)
@@ -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 @@
@Embeddable
public class TvMagazinPk implements Serializable {
@ManyToOne
+ @JoinColumn(nullable=false)
public Channel channel;
//public String name;
@ManyToOne
+ @JoinColumn(nullable=false)
public Presenter presenter;
}
Modified:
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/collectionelement/Boy.java
===================================================================
---
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/collectionelement/Boy.java 2010-02-25
03:50:02 UTC (rev 18879)
+++
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/collectionelement/Boy.java 2010-02-25
07:54:18 UTC (rev 18880)
@@ -5,6 +5,7 @@
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
@@ -19,6 +20,7 @@
import org.hibernate.annotations.CollectionOfElements;
import org.hibernate.annotations.IndexColumn;
+import org.hibernate.annotations.MapKey;
/**
* @author Emmanuel Bernard
@@ -74,7 +76,7 @@
public void setNickNames(Set<String> nickName) {
this.nickNames = nickName;
}
-
+ @MapKey(columns=@Column(nullable=false))
@CollectionOfElements
@JoinTable(name = "ScorePerNickName", joinColumns = @JoinColumn(name =
"BoyId"))
@Column(name = "score", nullable = false)
Modified:
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/collectionelement/LocalizedString.java
===================================================================
---
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/collectionelement/LocalizedString.java 2010-02-25
03:50:02 UTC (rev 18879)
+++
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/collectionelement/LocalizedString.java 2010-02-25
07:54:18 UTC (rev 18880)
@@ -33,7 +33,7 @@
new HashMap<String, String>( 1 );
@CollectionOfElements
- @MapKey( columns = @Column( name = "language_code" ) )
+ @MapKey( columns = @Column( name = "language_code",nullable=false ) )
@Fetch( FetchMode.JOIN )
@Filter( name = "selectedLocale",
condition = " language_code = :param " )
Modified:
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/collectionelement/Matrix.java
===================================================================
---
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/collectionelement/Matrix.java 2010-02-25
03:50:02 UTC (rev 18879)
+++
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/collectionelement/Matrix.java 2010-02-25
07:54:18 UTC (rev 18880)
@@ -1,14 +1,16 @@
//$
package org.hibernate.test.annotations.collectionelement;
+import java.util.HashMap;
import java.util.Map;
-import java.util.HashMap;
+
+import javax.persistence.Column;
import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
import javax.persistence.Id;
-import javax.persistence.GeneratedValue;
+import org.hibernate.annotations.CollectionOfElements;
import org.hibernate.annotations.MapKey;
-import org.hibernate.annotations.CollectionOfElements;
import org.hibernate.annotations.Type;
/**
@@ -19,7 +21,7 @@
@Id
@GeneratedValue
private Integer id;
- @MapKey(type = @Type(type="integer") )
+ @MapKey(type =
@Type(type="integer"),columns=@Column(name="mapkey",nullable=false) )
@CollectionOfElements
@Type(type = "float")
private Map<Integer, Float> values = new HashMap<Integer, Float>();
Modified:
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/collectionelement/indexedCollection/Sale.java
===================================================================
---
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/collectionelement/indexedCollection/Sale.java 2010-02-25
03:50:02 UTC (rev 18879)
+++
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/collectionelement/indexedCollection/Sale.java 2010-02-25
07:54:18 UTC (rev 18880)
@@ -28,7 +28,7 @@
name = "contact",
joinColumns = @JoinColumn(name = "n_key_person"))
@CollectionId(
- columns = @Column(name = "n_key_contact"),
+ columns = @Column(name = "n_key_contact",nullable=false),
type = @Type(type = "long"),
generator = "increment" )
private List<Contact> contacts = new ArrayList<Contact>();
Modified:
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/identifiercollection/Passport.java
===================================================================
---
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/identifiercollection/Passport.java 2010-02-25
03:50:02 UTC (rev 18879)
+++
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/identifiercollection/Passport.java 2010-02-25
07:54:18 UTC (rev 18880)
@@ -26,13 +26,13 @@
@ManyToMany(cascade = CascadeType.ALL)
@JoinTable(name="PASSPORT_STAMP")
- @CollectionId(columns = @Column(name="COLLECTION_ID"),
type=@Type(type="long"), generator = "generator")
+ @CollectionId(columns = @Column(name="COLLECTION_ID",nullable=false),
type=@Type(type="long"), generator = "generator")
@TableGenerator(name="generator", table="IDSTAMP")
private Collection<Stamp> stamps = new ArrayList();
@ManyToMany(cascade = CascadeType.ALL)
@JoinTable(name="PASSPORT_VISASTAMP")
- @CollectionId(columns = @Column(name="COLLECTION_ID"),
type=@Type(type="long"), generator = "ids_generator")
+ @CollectionId(columns = @Column(name="COLLECTION_ID",nullable=false),
type=@Type(type="long"), generator = "ids_generator")
//TODO test identity generator
private Collection<Stamp> visaStamp = new ArrayList();
Modified:
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/indexcoll/Atmosphere.java
===================================================================
---
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/indexcoll/Atmosphere.java 2010-02-25
03:50:02 UTC (rev 18879)
+++
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/indexcoll/Atmosphere.java 2010-02-25
07:54:18 UTC (rev 18880)
@@ -26,7 +26,7 @@
public Integer id;
@ManyToMany(cascade = CascadeType.ALL)
- @MapKey(columns = {@Column(name="gas_name")})
+ @MapKey(columns = {@Column(name="gas_name",nullable=false)})
public Map<String, Gas> gases = new HashMap<String, Gas>();
@ManyToMany(cascade = CascadeType.ALL)
Modified:
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/target/SizeImpl.java
===================================================================
---
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/target/SizeImpl.java 2010-02-25
03:50:02 UTC (rev 18879)
+++
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/target/SizeImpl.java 2010-02-25
07:54:18 UTC (rev 18880)
@@ -1,6 +1,7 @@
//$Id: $
package org.hibernate.test.annotations.target;
+import javax.persistence.Column;
import javax.persistence.Embeddable;
/**
@@ -8,8 +9,9 @@
*/
@Embeddable
public class SizeImpl implements Size {
+ @Column(nullable=false)
private String name;
-
+
public String getName() {
return name;
}