2 Copyright 2010 Sun Microsystems, Inc.
3 All rights reserved. Use is subject to license terms.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; version 2 of the License.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 package com.mysql.clusterj.jpatest.model;
21 import java.util.Date;
23 import javax.persistence.Column;
24 import javax.persistence.Entity;
25 import javax.persistence.Id;
26 import javax.persistence.Table;
30 drop table if exists timestamptypes;
31 create table timestamptypes (
32 id int not null primary key,
34 timestamp_not_null_hash timestamp,
35 timestamp_not_null_btree timestamp,
36 timestamp_not_null_both timestamp,
37 timestamp_not_null_none timestamp
39 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
41 create unique index idx_timestamp_not_null_hash using hash on timestamptypes(timestamp_not_null_hash);
42 create index idx_timestamp_not_null_btree on timestamptypes(timestamp_not_null_btree);
43 create unique index idx_timestamp_not_null_both on timestamptypes(timestamp_not_null_both);
47 @Table(name="datetimetypes")
48 public class TimestampAsUtilDateTypes implements IdBase {
51 private Date datetime_not_null_hash;
52 private Date datetime_not_null_btree;
53 private Date datetime_not_null_both;
54 private Date datetime_not_null_none;
60 public void setId(int id) {
65 @Column(name="datetime_not_null_hash")
66 public Date getTimestamp_not_null_hash() {
67 return datetime_not_null_hash;
69 public void setTimestamp_not_null_hash(Date value) {
70 this.datetime_not_null_hash = value;
73 @Column(name="datetime_not_null_btree")
74 public Date getTimestamp_not_null_btree() {
75 return datetime_not_null_btree;
77 public void setTimestamp_not_null_btree(Date value) {
78 this.datetime_not_null_btree = value;
81 @Column(name="datetime_not_null_both")
82 public Date getTimestamp_not_null_both() {
83 return datetime_not_null_both;
85 public void setTimestamp_not_null_both(Date value) {
86 this.datetime_not_null_both = value;
89 @Column(name="datetime_not_null_none")
90 public Date getTimestamp_not_null_none() {
91 return datetime_not_null_none;
93 public void setTimestamp_not_null_none(Date value) {
94 this.datetime_not_null_none = value;