HHH-5732 Corrected test failing on SQL Server

This commit is contained in:
Brett Meyer 2013-03-11 16:41:22 -04:00
parent 3815080207
commit 13dce3379a
5 changed files with 13 additions and 24 deletions

View File

@ -25,11 +25,14 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
/**
* @author Brett Meyer
*/
@Entity
// "Transaction" reserved in some Dialects
@Table( name = "BankTransaction" )
public class Transaction {
@Id

View File

@ -23,7 +23,6 @@
*/
package org.hibernate.test.collection.list;
import java.math.BigDecimal;
/**
* @author Steve Ebersole
@ -32,17 +31,15 @@ public class LineItem {
private Integer id;
private Order order;
private String productCode;
private BigDecimal costPer;
private int quantity;
public LineItem() {
}
public LineItem(Order order, String productCode, int quantity, BigDecimal costPer) {
public LineItem(Order order, String productCode, int quantity) {
this.order = order;
this.productCode = productCode;
this.quantity = quantity;
this.costPer = costPer;
}
public Integer getId() {
@ -69,14 +66,6 @@ public class LineItem {
this.productCode = productCode;
}
public BigDecimal getCostPer() {
return costPer;
}
public void setCostPer(BigDecimal costPer) {
this.costPer = costPer;
}
public int getQuantity() {
return quantity;
}

View File

@ -1,13 +1,13 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="org.hibernate.test.collection.list">
<class name="ListOwner">
<id name="name" column="NAME" type="string" />
<id name="name" column="NAME" type="string" />
<many-to-one name="parent" class="ListOwner" cascade="none" />
@ -16,7 +16,7 @@
<list-index column="LIST_INDEX"/>
<one-to-many class="ListOwner" />
</list>
</class>
</class>
<class name="Order" table="T_ORDER">
<id name="id" column="id" type="integer">
@ -37,7 +37,6 @@
<many-to-one name="order" class="Order" column="order_id" cascade="all"/>
<property name="productCode" column="PRD_CODE" type="string"/>
<property name="quantity" column="qty" type="integer"/>
<property name="costPer" column="cost_per" type="big_decimal"/>
</class>
</hibernate-mapping>

View File

@ -23,7 +23,6 @@
*/
package org.hibernate.test.collection.list;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@ -66,8 +65,8 @@ public class Order {
this.lineItems = lineItems;
}
public LineItem addLineItem(String productCode, int quantity, BigDecimal costPer) {
LineItem lineItem = new LineItem( this, productCode, quantity, costPer );
public LineItem addLineItem(String productCode, int quantity) {
LineItem lineItem = new LineItem( this, productCode, quantity );
lineItems.add( lineItem );
return lineItem;
}

View File

@ -27,7 +27,6 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@ -132,9 +131,9 @@ public class PersistentListTest extends BaseCoreFunctionalTestCase {
session.beginTransaction();
Order order = new Order( "acme-1" );
order.addLineItem( "abc", 2, new BigDecimal( 16.1 ) );
order.addLineItem( "def", 200, new BigDecimal( .01 ) );
order.addLineItem( "ghi", 13, new BigDecimal( 12.9 ) );
order.addLineItem( "abc", 2 );
order.addLineItem( "def", 200 );
order.addLineItem( "ghi", 13 );
session.save( order );
session.getTransaction().commit();
session.close();