1 /* 2 Copyright (c) 2010, 2021, Oracle and/or its affiliates. 3 All rights reserved. Use is subject to license terms. 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License, version 2.0, 7 as published by the Free Software Foundation. 8 9 This program is also distributed with certain software (including 10 but not limited to OpenSSL) that is licensed under separate terms, 11 as designated in a particular file or component or in included license 12 documentation. The authors of MySQL hereby grant you an additional 13 permission to link the program and your derivative works with the 14 separately licensed software that they have included with MySQL. 15 16 This program is distributed in the hope that it will be useful, 17 but WITHOUT ANY WARRANTY; without even the implied warranty of 18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 GNU General Public License, version 2.0, for more details. 20 21 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 24 */ 25 26 package testsuite.clusterj.model; 27 28 import com.mysql.clusterj.annotation.Column; 29 import com.mysql.clusterj.annotation.Index; 30 import com.mysql.clusterj.annotation.Indices; 31 import com.mysql.clusterj.annotation.PersistenceCapable; 32 import com.mysql.clusterj.annotation.PrimaryKey; 33 import java.sql.Date; 34 35 /** Schema 36 * 37 drop table if exists datetypes; 38 create table datetypes ( 39 id int not null primary key, 40 41 date_null_hash date, 42 date_null_btree date, 43 date_null_both date, 44 date_null_none date, 45 46 date_not_null_hash date, 47 date_not_null_btree date, 48 date_not_null_both date, 49 date_not_null_none date 50 51 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1; 52 53 create unique index idx_date_null_hash using hash on datetypes(date_null_hash); 54 create index idx_date_null_btree on datetypes(date_null_btree); 55 create unique index idx_date_null_both on datetypes(date_null_both); 56 57 create unique index idx_date_not_null_hash using hash on datetypes(date_not_null_hash); 58 create index idx_date_not_null_btree on datetypes(date_not_null_btree); 59 create unique index idx_date_not_null_both on datetypes(date_not_null_both); 60 61 */ 62 @Indices({ 63 @Index(name="idx_date_not_null_both", columns=@Column(name="date_not_null_both")) 64 }) 65 @PersistenceCapable(table="datetypes") 66 @PrimaryKey(column="id") 67 public interface DateAsSqlDateTypes extends IdBase { 68 getId()69 int getId(); setId(int id)70 void setId(int id); 71 72 // Date 73 @Column(name="date_not_null_hash") 74 @Index(name="idx_date_not_null_hash") getDate_not_null_hash()75 Date getDate_not_null_hash(); setDate_not_null_hash(Date value)76 void setDate_not_null_hash(Date value); 77 78 @Column(name="date_not_null_btree") 79 @Index(name="idx_date_not_null_btree") getDate_not_null_btree()80 Date getDate_not_null_btree(); setDate_not_null_btree(Date value)81 void setDate_not_null_btree(Date value); 82 83 @Column(name="date_not_null_both") getDate_not_null_both()84 Date getDate_not_null_both(); setDate_not_null_both(Date value)85 void setDate_not_null_both(Date value); 86 87 @Column(name="date_not_null_none") getDate_not_null_none()88 Date getDate_not_null_none(); setDate_not_null_none(Date value)89 void setDate_not_null_none(Date value); 90 91 } 92