1 /*
2    Copyright (c) 2010, 2021, Oracle and/or its affiliates.
3 
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License, version 2.0,
6    as published by the Free Software Foundation.
7 
8    This program is also distributed with certain software (including
9    but not limited to OpenSSL) that is licensed under separate terms,
10    as designated in a particular file or component or in included license
11    documentation.  The authors of MySQL hereby grant you an additional
12    permission to link the program and your derivative works with the
13    separately licensed software that they have included with MySQL.
14 
15    This program is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18    GNU General Public License, version 2.0, for more details.
19 
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
23 */
24 
25 package com.mysql.clusterj.jpatest.model;
26 
27 import java.math.BigDecimal;
28 
29 import javax.persistence.Column;
30 import javax.persistence.Entity;
31 import javax.persistence.Id;
32 import javax.persistence.Table;
33 
34 /** Schema
35  *
36 drop table if exists decimaltypes;
37 create table decimaltypes (
38  id int not null primary key,
39 
40  decimal_null_hash decimal(10,5),
41  decimal_null_btree decimal(10,5),
42  decimal_null_both decimal(10,5),
43  decimal_null_none decimal(10,5)
44 
45 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
46 
47 create unique index idx_decimal_null_hash using hash on decimaltypes(decimal_null_hash);
48 create index idx_decimal_null_btree on decimaltypes(decimal_null_btree);
49 create unique index idx_decimal_null_both on decimaltypes(decimal_null_both);
50 
51  */
52 @Entity
53 @Table(name="decimaltypes")
54 public class DecimalTypes implements IdBase {
55 
56     @Id
57     int id;
58     @Column(precision=10,scale=5)
59     BigDecimal decimal_null_hash;
60     @Column(precision=10,scale=5)
61     BigDecimal decimal_null_btree;
62     @Column(precision=10,scale=5)
63     BigDecimal decimal_null_both;
64     @Column(precision=10,scale=5)
65     BigDecimal decimal_null_none;
66 
getId()67     public int getId() {
68         return id;
69     }
setId(int id)70     public void setId(int id) {
71         this.id = id;
72     }
getDecimal_null_hash()73     public BigDecimal getDecimal_null_hash() {
74         return decimal_null_hash;
75     }
setDecimal_null_hash(BigDecimal decimalNullHash)76     public void setDecimal_null_hash(BigDecimal decimalNullHash) {
77         decimal_null_hash = decimalNullHash;
78     }
getDecimal_null_btree()79     public BigDecimal getDecimal_null_btree() {
80         return decimal_null_btree;
81     }
setDecimal_null_btree(BigDecimal decimalNullBtree)82     public void setDecimal_null_btree(BigDecimal decimalNullBtree) {
83         decimal_null_btree = decimalNullBtree;
84     }
getDecimal_null_both()85     public BigDecimal getDecimal_null_both() {
86         return decimal_null_both;
87     }
setDecimal_null_both(BigDecimal decimalNullBoth)88     public void setDecimal_null_both(BigDecimal decimalNullBoth) {
89         decimal_null_both = decimalNullBoth;
90     }
getDecimal_null_none()91     public BigDecimal getDecimal_null_none() {
92         return decimal_null_none;
93     }
setDecimal_null_none(BigDecimal decimalNullNone)94     public void setDecimal_null_none(BigDecimal decimalNullNone) {
95         decimal_null_none = decimalNullNone;
96     }
97 
98 }
99