2
/*___INFO__MARK_BEGIN__*/
3
/*************************************************************************
5
* The Contents of this file are made available subject to the terms of
6
* the Sun Industry Standards Source License Version 1.2
8
* Sun Microsystems Inc., March, 2001
11
* Sun Industry Standards Source License Version 1.2
12
* =================================================
13
* The contents of this file are subject to the Sun Industry Standards
14
* Source License Version 1.2 (the "License"); You may not use this file
15
* except in compliance with the License. You may obtain a copy of the
16
* License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
18
* Software provided under this License is provided on an "AS IS" basis,
19
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
20
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
21
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
22
* See the License for the specific provisions governing your rights and
23
* obligations concerning the Software.
25
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
27
* Copyright: 2001 by Sun Microsystems, Inc.
29
* All Rights Reserved.
31
************************************************************************/
32
/*___INFO__MARK_END__*/
35
* Generated from java_event_pkinfo.jsp
36
* !!! DO NOT EDIT THIS FILE !!!
46
java.util.Map<String,PKField> pkMap = new java.util.HashMap<String,PKField>();
51
for(int i = 0; i < cullObj.getPrimaryKeyCount(); i++) {
52
attr = cullObj.getPrimaryKeyAttr(i);
54
PKField field = new PKField();
55
field.name = jh.getAttrName(attr);
56
if( field.name.endsWith("List") ) {
57
field.name = field.name.substring(0, field.name.length() - 4 );
59
field.type = jh.getFullClassName(attr.getType());
60
if(field.type.equals(String.class.getName())) {
62
throw new IllegalStateException("cull type " + cullObj.getName() + " has more then two string primary key fields");
64
field.key = "strKey" + pkStrIndex;
68
throw new IllegalStateException("cull type " + cullObj.getName() + " has more then two numeric primary key fields");
70
field.key = "numKey" + pkNumIndex;
73
pkMap.put(field.name, field);
76
if(cullObj.getName().equals("JAT_Type")) {
77
PKField taskNumber = (PKField)pkMap.get("taskNumber");
78
taskNumber.key = "numKey2";
80
PKField jobid = new PKField();
83
jobid.key = "numKey1";
84
pkMap.put(jobid.name, jobid);
87
if (cullObj.getName().equals("PET_Type")) {
88
PKField jobid = new PKField();
91
jobid.key = "numKey1";
92
pkMap.put(jobid.name, jobid);
94
PKField taskNumber = new PKField();
95
taskNumber.name = "taskNumber";
96
taskNumber.type = "int";
97
taskNumber.key = "numKey2";
98
pkMap.put(taskNumber.name, taskNumber);
101
for (PKField field : pkMap.values()) {
102
%> private <%=field.type%> m_<%=field.name%>;
108
* Set the primary key info of the <%=name%>.
110
* This method is not indented for public usage. It is called from the
111
* native code to set the primary key info of cull event.
113
* @param numKey1 first numerical key
114
* @param numKey2 second numerical key
115
* @param strKey1 fist string key
116
* @param strKey2 second string key
118
public void setPKInfo(int numKey1, int numKey2, String strKey1, String strKey2) {
120
for (PKField field : pkMap.values()) {
122
m_<%=field.name%> = <%=field.key%>;
129
// Accessor for the primary key information
130
for (PKField field : pkMap.values()) {
131
String gsmName = Character.toUpperCase(field.name.charAt(0)) + field.name.substring(1);
134
* Get the <%=field.name%> of the <%=name%>
136
* @return the <%=field.name%> of the <%=name%>
138
public <%=field.type%> get<%=gsmName%>() {
139
return m_<%=field.name%>;