Skip to content

Commit

Permalink
HHH-9736 : BigIntegerType should use BigIntTypeDescriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
gbadner committed Apr 28, 2015
1 parent 829709f commit 7202020
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
Expand Up @@ -28,6 +28,7 @@


import org.hibernate.dialect.Dialect; import org.hibernate.dialect.Dialect;
import org.hibernate.type.descriptor.java.BigIntegerTypeDescriptor; import org.hibernate.type.descriptor.java.BigIntegerTypeDescriptor;
import org.hibernate.type.descriptor.sql.BigIntTypeDescriptor;
import org.hibernate.type.descriptor.sql.NumericTypeDescriptor; import org.hibernate.type.descriptor.sql.NumericTypeDescriptor;


/** /**
Expand All @@ -43,7 +44,7 @@ public class BigIntegerType
public static final BigIntegerType INSTANCE = new BigIntegerType(); public static final BigIntegerType INSTANCE = new BigIntegerType();


public BigIntegerType() { public BigIntegerType() {
super( NumericTypeDescriptor.INSTANCE, BigIntegerTypeDescriptor.INSTANCE ); super( BigIntTypeDescriptor.INSTANCE, BigIntegerTypeDescriptor.INSTANCE );
} }


@Override @Override
Expand Down
@@ -1,6 +1,7 @@
//$Id$ //$Id$
package org.hibernate.test.annotations.id.entities; package org.hibernate.test.annotations.id.entities;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger; import java.math.BigInteger;
import java.util.Set; import java.util.Set;
import javax.persistence.CascadeType; import javax.persistence.CascadeType;
Expand All @@ -26,7 +27,7 @@ public class Bunny implements Serializable {
@GeneratedValue(strategy = GenerationType.IDENTITY, generator = "java5_uuid") @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "java5_uuid")
@GenericGenerator(name = "java5_uuid", strategy = "org.hibernate.test.annotations.id.UUIDGenerator") @GenericGenerator(name = "java5_uuid", strategy = "org.hibernate.test.annotations.id.UUIDGenerator")
@Column(name = "id", precision = 128, scale = 0) @Column(name = "id", precision = 128, scale = 0)
private BigInteger id; private BigDecimal id;


@OneToMany(mappedBy = "bunny", cascade = { CascadeType.PERSIST }) @OneToMany(mappedBy = "bunny", cascade = { CascadeType.PERSIST })
Set<PointyTooth> teeth; Set<PointyTooth> teeth;
Expand All @@ -38,7 +39,7 @@ public void setTeeth(Set<PointyTooth> teeth) {
this.teeth = teeth; this.teeth = teeth;
} }


public BigInteger getId() { public BigDecimal getId() {
return id; return id;
} }
} }
@@ -1,7 +1,7 @@
//$Id$ //$Id$
package org.hibernate.test.annotations.id.entities; package org.hibernate.test.annotations.id.entities;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigInteger; import java.math.BigDecimal;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
Expand All @@ -26,7 +26,7 @@ public class PointyTooth implements Serializable {
@GeneratedValue(strategy = GenerationType.IDENTITY, generator = "java5_uuid") @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "java5_uuid")
@GenericGenerator(name = "java5_uuid", strategy = "org.hibernate.test.annotations.id.UUIDGenerator") @GenericGenerator(name = "java5_uuid", strategy = "org.hibernate.test.annotations.id.UUIDGenerator")
@Column(name = "id", precision = 128, scale = 0) @Column(name = "id", precision = 128, scale = 0)
private BigInteger id; private BigDecimal id;


@ManyToOne @ManyToOne
@JoinColumn(name = "bunny_id") @JoinColumn(name = "bunny_id")
Expand All @@ -36,7 +36,7 @@ public void setBunny(Bunny bunny) {
this.bunny = bunny; this.bunny = bunny;
} }


public BigInteger getId() { public BigDecimal getId() {
return id; return id;
} }
} }
@@ -1,6 +1,7 @@
//$Id$ //$Id$
package org.hibernate.test.annotations.id.entities; package org.hibernate.test.annotations.id.entities;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger; import java.math.BigInteger;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
Expand All @@ -26,7 +27,7 @@ public class TwinkleToes implements Serializable {
@GeneratedValue(strategy = GenerationType.IDENTITY, generator = "java5_uuid") @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "java5_uuid")
@GenericGenerator(name = "java5_uuid", strategy = "org.hibernate.test.annotations.id.UUIDGenerator") @GenericGenerator(name = "java5_uuid", strategy = "org.hibernate.test.annotations.id.UUIDGenerator")
@Column(name = "id", precision = 128, scale = 0) @Column(name = "id", precision = 128, scale = 0)
private BigInteger id; private BigDecimal id;


@ManyToOne @ManyToOne
@JoinColumn(name = "bunny_id") @JoinColumn(name = "bunny_id")
Expand All @@ -36,7 +37,7 @@ public void setBunny(Bunny bunny) {
this.bunny = bunny; this.bunny = bunny;
} }


public BigInteger getId() { public BigDecimal getId() {
return id; return id;
} }
} }
@@ -1,7 +1,7 @@
//$Id: Bunny.java 14761 2008-06-11 13:51:06Z hardy.ferentschik $ //$Id: Bunny.java 14761 2008-06-11 13:51:06Z hardy.ferentschik $
package org.hibernate.test.annotations.id.sequences.entities; package org.hibernate.test.annotations.id.sequences.entities;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigInteger; import java.math.BigDecimal;
import java.util.Set; import java.util.Set;
import javax.persistence.CascadeType; import javax.persistence.CascadeType;
import javax.persistence.Column; import javax.persistence.Column;
Expand All @@ -26,7 +26,7 @@ public class Bunny implements Serializable {
@GeneratedValue(strategy = GenerationType.IDENTITY, generator = "java5_uuid") @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "java5_uuid")
@GenericGenerator(name = "java5_uuid", strategy = "org.hibernate.test.annotations.id.UUIDGenerator") @GenericGenerator(name = "java5_uuid", strategy = "org.hibernate.test.annotations.id.UUIDGenerator")
@Column(name = "id", precision = 128, scale = 0) @Column(name = "id", precision = 128, scale = 0)
private BigInteger id; private BigDecimal id;


@OneToMany(mappedBy = "bunny", cascade = { CascadeType.PERSIST }) @OneToMany(mappedBy = "bunny", cascade = { CascadeType.PERSIST })
Set<PointyTooth> teeth; Set<PointyTooth> teeth;
Expand All @@ -38,7 +38,7 @@ public void setTeeth(Set<PointyTooth> teeth) {
this.teeth = teeth; this.teeth = teeth;
} }


public BigInteger getId() { public BigDecimal getId() {
return id; return id;
} }
} }
@@ -1,7 +1,7 @@
//$Id: PointyTooth.java 14761 2008-06-11 13:51:06Z hardy.ferentschik $ //$Id: PointyTooth.java 14761 2008-06-11 13:51:06Z hardy.ferentschik $
package org.hibernate.test.annotations.id.sequences.entities; package org.hibernate.test.annotations.id.sequences.entities;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigInteger; import java.math.BigDecimal;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
Expand All @@ -26,7 +26,7 @@ public class PointyTooth implements Serializable {
@GeneratedValue(strategy = GenerationType.IDENTITY, generator = "java5_uuid") @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "java5_uuid")
@GenericGenerator(name = "java5_uuid", strategy = "org.hibernate.test.annotations.id.UUIDGenerator") @GenericGenerator(name = "java5_uuid", strategy = "org.hibernate.test.annotations.id.UUIDGenerator")
@Column(name = "id", precision = 128, scale = 0) @Column(name = "id", precision = 128, scale = 0)
private BigInteger id; private BigDecimal id;


@ManyToOne @ManyToOne
@JoinColumn(name = "bunny_id") @JoinColumn(name = "bunny_id")
Expand All @@ -36,7 +36,7 @@ public void setBunny(Bunny bunny) {
this.bunny = bunny; this.bunny = bunny;
} }


public BigInteger getId() { public BigDecimal getId() {
return id; return id;
} }
} }
@@ -1,7 +1,7 @@
//$Id: TwinkleToes.java 14761 2008-06-11 13:51:06Z hardy.ferentschik $ //$Id: TwinkleToes.java 14761 2008-06-11 13:51:06Z hardy.ferentschik $
package org.hibernate.test.annotations.id.sequences.entities; package org.hibernate.test.annotations.id.sequences.entities;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigInteger; import java.math.BigDecimal;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
Expand All @@ -26,7 +26,7 @@ public class TwinkleToes implements Serializable {
@GeneratedValue(strategy = GenerationType.IDENTITY, generator = "java5_uuid") @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "java5_uuid")
@GenericGenerator(name = "java5_uuid", strategy = "org.hibernate.test.annotations.id.UUIDGenerator") @GenericGenerator(name = "java5_uuid", strategy = "org.hibernate.test.annotations.id.UUIDGenerator")
@Column(name = "id", precision = 128, scale = 0) @Column(name = "id", precision = 128, scale = 0)
private BigInteger id; private BigDecimal id;


@ManyToOne @ManyToOne
@JoinColumn(name = "bunny_id") @JoinColumn(name = "bunny_id")
Expand All @@ -36,7 +36,7 @@ public void setBunny(Bunny bunny) {
this.bunny = bunny; this.bunny = bunny;
} }


public BigInteger getId() { public BigDecimal getId() {
return id; return id;
} }
} }
Expand Up @@ -26,10 +26,8 @@
import org.junit.Test; import org.junit.Test;


import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.dialect.SQLServer2012Dialect;
import org.hibernate.testing.DialectChecks; import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;


/** /**
Expand All @@ -42,7 +40,6 @@ public String[] getMappings() {
} }


@Test @Test
@SkipForDialect( SQLServer2012Dialect.class )
public void testBasics() { public void testBasics() {
Session s = openSession(); Session s = openSession();
s.beginTransaction(); s.beginTransaction();
Expand Down

0 comments on commit 7202020

Please sign in to comment.