コード例 #1
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((id == null) ? 0 : id.hashCode());
   result = prime * result + ((optionValuePrice == null) ? 0 : optionValuePrice.hashCode());
   result = prime * result + ((order == null) ? 0 : order.hashCode());
   result = prime * result + ((orderProduct == null) ? 0 : orderProduct.hashCode());
   result = prime * result + ((pricePrefix == null) ? 0 : pricePrefix.hashCode());
   result = prime * result + ((productOption == null) ? 0 : productOption.hashCode());
   result = prime * result + ((productOptionValue == null) ? 0 : productOptionValue.hashCode());
   return result;
 }
コード例 #2
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((finalPrice == null) ? 0 : finalPrice.hashCode());
   result = prime * result + ((id == null) ? 0 : id.hashCode());
   result = prime * result + ((order == null) ? 0 : order.hashCode());
   result = prime * result + ((product == null) ? 0 : product.hashCode());
   result = prime * result + ((productsModel == null) ? 0 : productsModel.hashCode());
   result = prime * result + ((productsName == null) ? 0 : productsName.hashCode());
   result = prime * result + ((productsPrice == null) ? 0 : productsPrice.hashCode());
   result = prime * result + productsQuantity;
   result = prime * result + ((productsTax == null) ? 0 : productsTax.hashCode());
   return result;
 }
コード例 #3
0
 @Test
 public void testHashCode() {
   assertThat(order1.hashCode(), is(order2.hashCode()));
   assertThat(order1.hashCode() == order3.hashCode(), is(false));
 }
コード例 #4
0
ファイル: LineItemPK.java プロジェクト: hadadil/hibernate-orm
 public int hashCode() {
   int result;
   result = order.hashCode();
   result = 31 * result + productCode.hashCode();
   return result;
 }