mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-09 12:44:49 +00:00
HHH-5732 Corrected test failing on SQL Server
This commit is contained in:
parent
2d1596086e
commit
809a4d15e7
@ -25,11 +25,14 @@
|
||||
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
|
||||
|
@ -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 void setProductCode(String productCode) {
|
||||
this.productCode = productCode;
|
||||
}
|
||||
|
||||
public BigDecimal getCostPer() {
|
||||
return costPer;
|
||||
}
|
||||
|
||||
public void setCostPer(BigDecimal costPer) {
|
||||
this.costPer = costPer;
|
||||
}
|
||||
|
||||
public int getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
@ -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>
|
@ -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 void setLineItems(List<LineItem> lineItems) {
|
||||
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;
|
||||
}
|
||||
|
@ -27,7 +27,6 @@
|
||||
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 void testInverseListIndex2() {
|
||||
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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user