1 /*
2  *  Copyright (c) 2013, 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 testsuite.clusterj.model;
26 
27 import com.mysql.clusterj.annotation.Column;
28 import com.mysql.clusterj.annotation.Index;
29 import com.mysql.clusterj.annotation.PersistenceCapable;
30 import com.mysql.clusterj.annotation.PrimaryKey;
31 
32 /** Schema
33  *
34 DROP TABLE IF EXISTS conversation_summary;
35 CREATE TABLE conversation_summary (
36   source_user_id bigint(11) NOT NULL,
37   destination_user_id bigint(11) NOT NULL,
38   last_message_user_id bigint(11) NOT NULL,
39   text_summary varchar(255) NOT NULL DEFAULT '',
40   query_history_id bigint(20) NOT NULL DEFAULT '0',
41   answerer_id bigint(11) NOT NULL,
42   viewed bit(1) NOT NULL,
43   updated_at bigint(20) NOT NULL,
44   PRIMARY KEY (source_user_id,destination_user_id,query_history_id),
45   KEY IX_updated_at (updated_at)
46 ) ENGINE=ndbcluster;
47 
48  */
49 @PersistenceCapable(table="conversation_summary")
50 public interface ConversationSummary {
51 
52     @PrimaryKey
53     @Column(name = "source_user_id")
getSourceUserId()54     long getSourceUserId();
setSourceUserId(long id)55     void setSourceUserId(long id);
56 
57     @PrimaryKey
58     @Column(name = "destination_user_id")
getDestUserId()59     long getDestUserId();
setDestUserId(long id)60     void setDestUserId(long id);
61 
62     @Column(name = "last_message_user_id")
getLastMessageById()63     long getLastMessageById();
setLastMessageById(long id)64     void setLastMessageById(long id);
65 
66     @Column(name = "text_summary")
getText()67     String getText();
setText(String text)68     void setText(String text);
69 
70     @PrimaryKey
71     @Column(name = "query_history_id")
getQueryHistoryId()72     long getQueryHistoryId();
setQueryHistoryId(long id)73     void setQueryHistoryId(long id);
74 
75     @Column(name = "answerer_id")
getAnswererId()76     long getAnswererId();
setAnswererId(long id)77     void setAnswererId(long id);
78 
79     @Column(name = "viewed")
getViewed()80     boolean getViewed();
setViewed(boolean viewed)81     void setViewed(boolean viewed);
82 
83     @Column(name = "updated_at")
84     @Index(name="IX_updated_at")
getUpdatedAt()85     long getUpdatedAt();
setUpdatedAt(long updated)86     void setUpdatedAt(long updated);
87 }
88