2 Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; version 2 of the License.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 package com.mysql.clusterj.jpatest.model;
20 import java.math.BigDecimal;
22 import javax.persistence.Column;
23 import javax.persistence.Entity;
24 import javax.persistence.Id;
25 import javax.persistence.Table;
29 drop table if exists decimaltypes;
30 create table decimaltypes (
31 id int not null primary key,
33 decimal_null_hash decimal(10,5),
34 decimal_null_btree decimal(10,5),
35 decimal_null_both decimal(10,5),
36 decimal_null_none decimal(10,5)
38 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
40 create unique index idx_decimal_null_hash using hash on decimaltypes(decimal_null_hash);
41 create index idx_decimal_null_btree on decimaltypes(decimal_null_btree);
42 create unique index idx_decimal_null_both on decimaltypes(decimal_null_both);
46 @Table(name="decimaltypes")
47 public class DecimalTypes implements IdBase {
51 @Column(precision=10,scale=5)
52 BigDecimal decimal_null_hash;
53 @Column(precision=10,scale=5)
54 BigDecimal decimal_null_btree;
55 @Column(precision=10,scale=5)
56 BigDecimal decimal_null_both;
57 @Column(precision=10,scale=5)
58 BigDecimal decimal_null_none;
63 public void setId(int id) {
66 public BigDecimal getDecimal_null_hash() {
67 return decimal_null_hash;
69 public void setDecimal_null_hash(BigDecimal decimalNullHash) {
70 decimal_null_hash = decimalNullHash;
72 public BigDecimal getDecimal_null_btree() {
73 return decimal_null_btree;
75 public void setDecimal_null_btree(BigDecimal decimalNullBtree) {
76 decimal_null_btree = decimalNullBtree;
78 public BigDecimal getDecimal_null_both() {
79 return decimal_null_both;
81 public void setDecimal_null_both(BigDecimal decimalNullBoth) {
82 decimal_null_both = decimalNullBoth;
84 public BigDecimal getDecimal_null_none() {
85 return decimal_null_none;
87 public void setDecimal_null_none(BigDecimal decimalNullNone) {
88 decimal_null_none = decimalNullNone;