##### Coverage Report - org.apache.turbine.services.security.torque.om.BaseTurbineRolePermission

Classes in this File | Line Coverage | Branch Coverage | Complexity
BaseTurbineRolePermission |
0% | 0/145
0% | 0/76
| 2.4594594594594597;2,459

1 |  |
     package org.apache.turbine.services.security.torque.om;
2 |  |
3 |  |
4 |  |
     import java.math.BigDecimal;
5 |  |
     import java.sql.Connection;
6 |  |
     import java.util.ArrayList;
7 |  |
     import java.util.Collections;
8 |  |
     import java.util.Date;
9 |  |
     import java.util.List;
10 |  |
11 |  |
     import org.apache.commons.lang.ObjectUtils;
12 |  |
     import org.apache.torque.TorqueException;
13 |  |
     import org.apache.torque.map.TableMap;
14 |  |
     import org.apache.torque.om.BaseObject;
15 |  |
     import org.apache.torque.om.ComboKey;
16 |  |
     import org.apache.torque.om.DateKey;
17 |  |
     import org.apache.torque.om.NumberKey;
18 |  |
     import org.apache.torque.om.ObjectKey;
19 |  |
     import org.apache.torque.om.SimpleKey;
20 |  |
     import org.apache.torque.om.StringKey;
21 |  |
     import org.apache.torque.om.Persistent;
22 |  |
     import org.apache.torque.util.Criteria;
23 |  |
     import org.apache.torque.util.Transaction;
24 |  |
25 |  |
26 |  |
27 |  |
28 |  |
29 |  |
     /**
30 |  |
      * This class was autogenerated by Torque on:
31 |  |
      *
32 |  |
      * [Thu Jun 23 17:25:46 CEST 2011]
33 |  |
      *
34 |  |
      * You should not use this class directly.  It should not even be
35 |  |
      * extended all references should be to TurbineRolePermission
36 |  |
      */
37 | 0 |
     public abstract class BaseTurbineRolePermission extends BaseObject
38 |  |
     {
39 |  |
         /** Serial version */
40 |  |
         private static final long serialVersionUID = 1308842746584L;
41 |  |
42 |  |
         /** The Peer class */
43 | 0 |
         private static final TurbineRolePermissionPeer peer =
44 |  |
             new TurbineRolePermissionPeer();
45 |  |
46 |  |
47 |  |
         /** The value for the roleId field */
48 |  |
         private int roleId;
49 |  |
50 |  |
         /** The value for the permissionId field */
51 |  |
         private int permissionId;
52 |  |
53 |  |
54 |  |
         /**
55 |  |
          * Get the RoleId
56 |  |
          *
57 |  |
          * @return int
58 |  |
          */
59 |  |
         public int getRoleId()
60 |  |
         {
61 | 0 |
             return roleId;
62 |  |
         }
63 |  |
64 |  |
65 |  |
         /**
66 |  |
          * Set the value of RoleId
67 |  |
          *
68 |  |
          * @param v new value
69 |  |
          */
70 |  |
         public void setRoleId(int v) throws TorqueException
71 |  |
         {
72 |  |
73 | 0 |
             if (this.roleId != v)
74 |  |
             {
75 | 0 |
                 this.roleId = v;
76 | 0 |
                 setModified(true);
77 |  |
             }
78 |  |
79 |  |
80 | 0 |
             if (aTurbineRole != null && !(aTurbineRole.getRoleId() == v))
81 |  |
             {
82 | 0 |
                 aTurbineRole = null;
83 |  |
             }
84 |  |
85 | 0 |
         }
86 |  |
87 |  |
         /**
88 |  |
          * Get the PermissionId
89 |  |
          *
90 |  |
          * @return int
91 |  |
          */
92 |  |
         public int getPermissionId()
93 |  |
         {
94 | 0 |
             return permissionId;
95 |  |
         }
96 |  |
97 |  |
98 |  |
         /**
99 |  |
          * Set the value of PermissionId
100 |  |
          *
101 |  |
          * @param v new value
102 |  |
          */
103 |  |
         public void setPermissionId(int v) throws TorqueException
104 |  |
         {
105 |  |
106 | 0 |
             if (this.permissionId != v)
107 |  |
             {
108 | 0 |
                 this.permissionId = v;
109 | 0 |
                 setModified(true);
110 |  |
             }
111 |  |
112 |  |
113 | 0 |
             if (aTurbinePermission != null && !(aTurbinePermission.getPermissionId() == v))
114 |  |
             {
115 | 0 |
                 aTurbinePermission = null;
116 |  |
             }
117 |  |
118 | 0 |
         }
119 |  |
120 |  |
121 |  |
122 |  |
123 |  |
124 |  |
         private TurbineRole aTurbineRole;
125 |  |
126 |  |
         /**
127 |  |
          * Declares an association between this object and a TurbineRole object
128 |  |
          *
129 |  |
          * @param v TurbineRole
130 |  |
          * @throws TorqueException
131 |  |
          */
132 |  |
         public void setTurbineRole(TurbineRole v) throws TorqueException
133 |  |
         {
134 | 0 |
             if (v == null)
135 |  |
             {
136 | 0 |
                 setRoleId( 0);
137 |  |
             }
138 |  |
             else
139 |  |
             {
140 | 0 |
                 setRoleId(v.getRoleId());
141 |  |
             }
142 | 0 |
             aTurbineRole = v;
143 | 0 |
         }
144 |  |
145 |  |
146 |  |
         /**
147 |  |
          * Returns the associated TurbineRole object.
148 |  |
          * If it was not retrieved before, the object is retrieved from
149 |  |
          * the database
150 |  |
          *
151 |  |
          * @return the associated TurbineRole object
152 |  |
          * @throws TorqueException
153 |  |
          */
154 |  |
         public TurbineRole getTurbineRole()
155 |  |
             throws TorqueException
156 |  |
         {
157 | 0 |
             if (aTurbineRole == null && (this.roleId != 0))
158 |  |
             {
159 | 0 |
                 aTurbineRole = TurbineRolePeer.retrieveByPK(SimpleKey.keyFor(this.roleId));
160 |  |
             }
161 | 0 |
             return aTurbineRole;
162 |  |
         }
163 |  |
164 |  |
         /**
165 |  |
          * Return the associated TurbineRole object
166 |  |
          * If it was not retrieved before, the object is retrieved from
167 |  |
          * the database using the passed connection
168 |  |
          *
169 |  |
          * @param connection the connection used to retrieve the associated object
170 |  |
          *        from the database, if it was not retrieved before
171 |  |
          * @return the associated TurbineRole object
172 |  |
          * @throws TorqueException
173 |  |
          */
174 |  |
         public TurbineRole getTurbineRole(Connection connection)
175 |  |
             throws TorqueException
176 |  |
         {
177 | 0 |
             if (aTurbineRole == null && (this.roleId != 0))
178 |  |
             {
179 | 0 |
                 aTurbineRole = TurbineRolePeer.retrieveByPK(SimpleKey.keyFor(this.roleId), connection);
180 |  |
             }
181 | 0 |
             return aTurbineRole;
182 |  |
         }
183 |  |
184 |  |
         /**
185 |  |
          * Provides convenient way to set a relationship based on a
186 |  |
          * ObjectKey, for example
187 |  |
          * <code>bar.setFooKey(foo.getPrimaryKey())</code>
188 |  |
          *
189 |  |
          */
190 |  |
         public void setTurbineRoleKey(ObjectKey key) throws TorqueException
191 |  |
         {
192 |  |
193 | 0 |
             setRoleId(((NumberKey) key).intValue());
194 | 0 |
         }
195 |  |
196 |  |
197 |  |
198 |  |
199 |  |
         private TurbinePermission aTurbinePermission;
200 |  |
201 |  |
         /**
202 |  |
          * Declares an association between this object and a TurbinePermission object
203 |  |
          *
204 |  |
          * @param v TurbinePermission
205 |  |
          * @throws TorqueException
206 |  |
          */
207 |  |
         public void setTurbinePermission(TurbinePermission v) throws TorqueException
208 |  |
         {
209 | 0 |
             if (v == null)
210 |  |
             {
211 | 0 |
                 setPermissionId( 0);
212 |  |
             }
213 |  |
             else
214 |  |
             {
215 | 0 |
                 setPermissionId(v.getPermissionId());
216 |  |
             }
217 | 0 |
             aTurbinePermission = v;
218 | 0 |
         }
219 |  |
220 |  |
221 |  |
         /**
222 |  |
          * Returns the associated TurbinePermission object.
223 |  |
          * If it was not retrieved before, the object is retrieved from
224 |  |
          * the database
225 |  |
          *
226 |  |
          * @return the associated TurbinePermission object
227 |  |
          * @throws TorqueException
228 |  |
          */
229 |  |
         public TurbinePermission getTurbinePermission()
230 |  |
             throws TorqueException
231 |  |
         {
232 | 0 |
             if (aTurbinePermission == null && (this.permissionId != 0))
233 |  |
             {
234 | 0 |
                 aTurbinePermission = TurbinePermissionPeer.retrieveByPK(SimpleKey.keyFor(this.permissionId));
235 |  |
             }
236 | 0 |
             return aTurbinePermission;
237 |  |
         }
238 |  |
239 |  |
         /**
240 |  |
          * Return the associated TurbinePermission object
241 |  |
          * If it was not retrieved before, the object is retrieved from
242 |  |
          * the database using the passed connection
243 |  |
          *
244 |  |
          * @param connection the connection used to retrieve the associated object
245 |  |
          *        from the database, if it was not retrieved before
246 |  |
          * @return the associated TurbinePermission object
247 |  |
          * @throws TorqueException
248 |  |
          */
249 |  |
         public TurbinePermission getTurbinePermission(Connection connection)
250 |  |
             throws TorqueException
251 |  |
         {
252 | 0 |
             if (aTurbinePermission == null && (this.permissionId != 0))
253 |  |
             {
254 | 0 |
                 aTurbinePermission = TurbinePermissionPeer.retrieveByPK(SimpleKey.keyFor(this.permissionId), connection);
255 |  |
             }
256 | 0 |
             return aTurbinePermission;
257 |  |
         }
258 |  |
259 |  |
         /**
260 |  |
          * Provides convenient way to set a relationship based on a
261 |  |
          * ObjectKey, for example
262 |  |
          * <code>bar.setFooKey(foo.getPrimaryKey())</code>
263 |  |
          *
264 |  |
          */
265 |  |
         public void setTurbinePermissionKey(ObjectKey key) throws TorqueException
266 |  |
         {
267 |  |
268 | 0 |
             setPermissionId(((NumberKey) key).intValue());
269 | 0 |
         }
270 |  |
271 |  |
272 | 0 |
         private static List<String> fieldNames = null;
273 |  |
274 |  |
         /**
275 |  |
          * Generate a list of field names.
276 |  |
          *
277 |  |
          * @return a list of field names
278 |  |
          */
279 |  |
         public static synchronized List<String> getFieldNames()
280 |  |
         {
281 | 0 |
             if (fieldNames == null)
282 |  |
             {
283 | 0 |
                 fieldNames = new ArrayList<String>();
284 | 0 |
                 fieldNames.add("RoleId");
285 | 0 |
                 fieldNames.add("PermissionId");
286 | 0 |
                 fieldNames = Collections.unmodifiableList(fieldNames);
287 |  |
             }
288 | 0 |
             return fieldNames;
289 |  |
         }
290 |  |
291 |  |
         /**
292 |  |
          * Retrieves a field from the object by field (Java) name passed in as a String.
293 |  |
          *
294 |  |
          * @param name field name
295 |  |
          * @return value
296 |  |
          */
297 |  |
         public Object getByName(String name)
298 |  |
         {
299 | 0 |
             if (name.equals("RoleId"))
300 |  |
             {
301 | 0 |
                 return new Integer(getRoleId());
302 |  |
             }
303 | 0 |
             if (name.equals("PermissionId"))
304 |  |
             {
305 | 0 |
                 return new Integer(getPermissionId());
306 |  |
             }
307 | 0 |
             return null;
308 |  |
         }
309 |  |
310 |  |
         /**
311 |  |
          * Set a field in the object by field (Java) name.
312 |  |
          *
313 |  |
          * @param name field name
314 |  |
          * @param value field value
315 |  |
          * @return True if value was set, false if not (invalid name / protected field).
316 |  |
          * @throws IllegalArgumentException if object type of value does not match field object type.
317 |  |
          * @throws TorqueException If a problem occurs with the set[Field] method.
318 |  |
          */
319 |  |
         public boolean setByName(String name, Object value )
320 |  |
             throws TorqueException, IllegalArgumentException
321 |  |
         {
322 | 0 |
             if (name.equals("RoleId"))
323 |  |
             {
324 | 0 |
                 if (value == null || ! (Integer.class.isInstance(value)))
325 |  |
                 {
326 | 0 |
                     throw new IllegalArgumentException("setByName: value parameter was null or not an Integer object.");
327 |  |
                 }
328 | 0 |
                 setRoleId(((Integer) value).intValue());
329 | 0 |
                 return true;
330 |  |
             }
331 | 0 |
             if (name.equals("PermissionId"))
332 |  |
             {
333 | 0 |
                 if (value == null || ! (Integer.class.isInstance(value)))
334 |  |
                 {
335 | 0 |
                     throw new IllegalArgumentException("setByName: value parameter was null or not an Integer object.");
336 |  |
                 }
337 | 0 |
                 setPermissionId(((Integer) value).intValue());
338 | 0 |
                 return true;
339 |  |
             }
340 | 0 |
             return false;
341 |  |
         }
342 |  |
343 |  |
         /**
344 |  |
          * Retrieves a field from the object by name passed in
345 |  |
          * as a String.  The String must be one of the static
346 |  |
          * Strings defined in this Class' Peer.
347 |  |
          *
348 |  |
          * @param name peer name
349 |  |
          * @return value
350 |  |
          */
351 |  |
         public Object getByPeerName(String name)
352 |  |
         {
353 | 0 |
             if (name.equals(TurbineRolePermissionPeer.ROLE_ID))
354 |  |
             {
355 | 0 |
                 return new Integer(getRoleId());
356 |  |
             }
357 | 0 |
             if (name.equals(TurbineRolePermissionPeer.PERMISSION_ID))
358 |  |
             {
359 | 0 |
                 return new Integer(getPermissionId());
360 |  |
             }
361 | 0 |
             return null;
362 |  |
         }
363 |  |
364 |  |
         /**
365 |  |
          * Set field values by Peer Field Name
366 |  |
          *
367 |  |
          * @param name field name
368 |  |
          * @param value field value
369 |  |
          * @return True if value was set, false if not (invalid name / protected field).
370 |  |
          * @throws IllegalArgumentException if object type of value does not match field object type.
371 |  |
          * @throws TorqueException If a problem occurs with the set[Field] method.
372 |  |
          */
373 |  |
         public boolean setByPeerName(String name, Object value)
374 |  |
             throws TorqueException, IllegalArgumentException
375 |  |
         {
376 | 0 |
           if (TurbineRolePermissionPeer.ROLE_ID.equals(name))
377 |  |
             {
378 | 0 |
                 return setByName("RoleId", value);
379 |  |
             }
380 | 0 |
           if (TurbineRolePermissionPeer.PERMISSION_ID.equals(name))
381 |  |
             {
382 | 0 |
                 return setByName("PermissionId", value);
383 |  |
             }
384 | 0 |
             return false;
385 |  |
         }
386 |  |
387 |  |
         /**
388 |  |
          * Retrieves a field from the object by Position as specified
389 |  |
          * in the xml schema.  Zero-based.
390 |  |
          *
391 |  |
          * @param pos position in xml schema
392 |  |
          * @return value
393 |  |
          */
394 |  |
         public Object getByPosition(int pos)
395 |  |
         {
396 | 0 |
             if (pos == 0)
397 |  |
             {
398 | 0 |
                 return new Integer(getRoleId());
399 |  |
             }
400 | 0 |
             if (pos == 1)
401 |  |
             {
402 | 0 |
                 return new Integer(getPermissionId());
403 |  |
             }
404 | 0 |
             return null;
405 |  |
         }
406 |  |
407 |  |
         /**
408 |  |
          * Set field values by its position (zero based) in the XML schema.
409 |  |
          *
410 |  |
          * @param position The field position
411 |  |
          * @param value field value
412 |  |
          * @return True if value was set, false if not (invalid position / protected field).
413 |  |
          * @throws IllegalArgumentException if object type of value does not match field object type.
414 |  |
          * @throws TorqueException If a problem occurs with the set[Field] method.
415 |  |
          */
416 |  |
         public boolean setByPosition(int position, Object value)
417 |  |
             throws TorqueException, IllegalArgumentException
418 |  |
         {
419 | 0 |
         if (position == 0)
420 |  |
             {
421 | 0 |
                 return setByName("RoleId", value);
422 |  |
             }
423 | 0 |
         if (position == 1)
424 |  |
             {
425 | 0 |
                 return setByName("PermissionId", value);
426 |  |
             }
427 | 0 |
             return false;
428 |  |
         }
429 |  |
430 |  |
         /**
431 |  |
          * Stores the object in the database.  If the object is new,
432 |  |
          * it inserts it; otherwise an update is performed.
433 |  |
          *
434 |  |
          * @throws Exception
435 |  |
          */
436 |  |
         public void save() throws Exception
437 |  |
         {
438 | 0 |
             save(TurbineRolePermissionPeer.DATABASE_NAME);
439 | 0 |
         }
440 |  |
441 |  |
         /**
442 |  |
          * Stores the object in the database.  If the object is new,
443 |  |
          * it inserts it; otherwise an update is performed.
444 |  |
          * Note: this code is here because the method body is
445 |  |
          * auto-generated conditionally and therefore needs to be
446 |  |
          * in this file instead of in the super class, BaseObject.
447 |  |
          *
448 |  |
          * @param dbName
449 |  |
          * @throws TorqueException
450 |  |
          */
451 |  |
         public void save(String dbName) throws TorqueException
452 |  |
         {
453 | 0 |
             Connection con = null;
454 |  |
             try
455 |  |
             {
456 | 0 |
                 con = Transaction.begin(dbName);
457 | 0 |
                 save(con);
458 | 0 |
                 Transaction.commit(con);
459 |  |
             }
460 | 0 |
             catch(TorqueException e)
461 |  |
             {
462 | 0 |
                 Transaction.safeRollback(con);
463 | 0 |
                 throw e;
464 | 0 |
             }
465 | 0 |
         }
466 |  |
467 |  |
         /** flag to prevent endless save loop, if this object is referenced
468 |  |
             by another object which falls in this transaction. */
469 | 0 |
         private boolean alreadyInSave = false;
470 |  |
         /**
471 |  |
          * Stores the object in the database.  If the object is new,
472 |  |
          * it inserts it; otherwise an update is performed.  This method
473 |  |
          * is meant to be used as part of a transaction, otherwise use
474 |  |
          * the save() method and the connection details will be handled
475 |  |
          * internally
476 |  |
          *
477 |  |
          * @param con
478 |  |
          * @throws TorqueException
479 |  |
          */
480 |  |
         public void save(Connection con) throws TorqueException
481 |  |
         {
482 | 0 |
             if (!alreadyInSave)
483 |  |
             {
484 | 0 |
                 alreadyInSave = true;
485 |  |
486 |  |
487 |  |
488 |  |
                 // If this object has been modified, then save it to the database.
489 | 0 |
                 if (isModified())
490 |  |
                 {
491 | 0 |
                     if (isNew())
492 |  |
                     {
493 | 0 |
                         TurbineRolePermissionPeer.doInsert((TurbineRolePermission) this, con);
494 | 0 |
                         setNew(false);
495 |  |
                     }
496 |  |
                     else
497 |  |
                     {
498 | 0 |
                         TurbineRolePermissionPeer.doUpdate((TurbineRolePermission) this, con);
499 |  |
                     }
500 |  |
                 }
501 |  |
502 | 0 |
                 alreadyInSave = false;
503 |  |
             }
504 | 0 |
         }
505 |  |
506 |  |
507 |  |
508 | 0 |
         private final SimpleKey[] pks = new SimpleKey[2];
509 | 0 |
         private final ComboKey comboPK = new ComboKey(pks);
510 |  |
511 |  |
         /**
512 |  |
          * Set the PrimaryKey with an ObjectKey
513 |  |
          *
514 |  |
          * @param key
515 |  |
          */
516 |  |
         public void setPrimaryKey(ObjectKey key) throws TorqueException
517 |  |
         {
518 | 0 |
             SimpleKey[] keys = (SimpleKey[]) key.getValue();
519 | 0 |
             setRoleId(((NumberKey)keys[0]).intValue());
520 | 0 |
             setPermissionId(((NumberKey)keys[1]).intValue());
521 | 0 |
         }
522 |  |
523 |  |
         /**
524 |  |
          * Set the PrimaryKey using SimpleKeys.
525 |  |
          *
526 |  |
          * @param roleId int
527 |  |
          * @param permissionId int
528 |  |
          */
529 |  |
         public void setPrimaryKey( int roleId, int permissionId)
530 |  |
             throws TorqueException
531 |  |
         {
532 | 0 |
             setRoleId(roleId);
533 | 0 |
             setPermissionId(permissionId);
534 | 0 |
         }
535 |  |
536 |  |
         /**
537 |  |
          * Set the PrimaryKey using a String.
538 |  |
          */
539 |  |
         public void setPrimaryKey(String key) throws TorqueException
540 |  |
         {
541 | 0 |
             setPrimaryKey(new ComboKey(key));
542 | 0 |
         }
543 |  |
544 |  |
         /**
545 |  |
          * returns an id that differentiates this object from others
546 |  |
          * of its class.
547 |  |
          */
548 |  |
         public ObjectKey getPrimaryKey()
549 |  |
         {
550 | 0 |
             pks[0] = SimpleKey.keyFor(getRoleId());
551 | 0 |
             pks[1] = SimpleKey.keyFor(getPermissionId());
552 | 0 |
             return comboPK;
553 |  |
         }
554 |  |
555 |  |
556 |  |
         /**
557 |  |
          * Makes a copy of this object.
558 |  |
          * It creates a new object filling in the simple attributes.
559 |  |
          * It then fills all the association collections and sets the
560 |  |
          * related objects to isNew=true.
561 |  |
          */
562 |  |
         public TurbineRolePermission copy() throws TorqueException
563 |  |
         {
564 | 0 |
             return copy(true);
565 |  |
         }
566 |  |
567 |  |
         /**
568 |  |
          * Makes a copy of this object using connection.
569 |  |
          * It creates a new object filling in the simple attributes.
570 |  |
          * It then fills all the association collections and sets the
571 |  |
          * related objects to isNew=true.
572 |  |
          *
573 |  |
          * @param con the database connection to read associated objects.
574 |  |
          */
575 |  |
         public TurbineRolePermission copy(Connection con) throws TorqueException
576 |  |
         {
577 | 0 |
             return copy(true, con);
578 |  |
         }
579 |  |
580 |  |
         /**
581 |  |
          * Makes a copy of this object.
582 |  |
          * It creates a new object filling in the simple attributes.
583 |  |
          * If the parameter deepcopy is true, it then fills all the
584 |  |
          * association collections and sets the related objects to
585 |  |
          * isNew=true.
586 |  |
          *
587 |  |
          * @param deepcopy whether to copy the associated objects.
588 |  |
          */
589 |  |
         public TurbineRolePermission copy(boolean deepcopy) throws TorqueException
590 |  |
         {
591 | 0 |
             return copyInto(new TurbineRolePermission(), deepcopy);
592 |  |
         }
593 |  |
594 |  |
         /**
595 |  |
          * Makes a copy of this object using connection.
596 |  |
          * It creates a new object filling in the simple attributes.
597 |  |
          * If the parameter deepcopy is true, it then fills all the
598 |  |
          * association collections and sets the related objects to
599 |  |
          * isNew=true.
600 |  |
          *
601 |  |
          * @param deepcopy whether to copy the associated objects.
602 |  |
          * @param con the database connection to read associated objects.
603 |  |
          */
604 |  |
         public TurbineRolePermission copy(boolean deepcopy, Connection con) throws TorqueException
605 |  |
         {
606 | 0 |
             return copyInto(new TurbineRolePermission(), deepcopy, con);
607 |  |
         }
608 |  |
609 |  |
         /**
610 |  |
          * Fills the copyObj with the contents of this object.
611 |  |
          * The associated objects are also copied and treated as new objects.
612 |  |
          *
613 |  |
          * @param copyObj the object to fill.
614 |  |
          */
615 |  |
         protected TurbineRolePermission copyInto(TurbineRolePermission copyObj) throws TorqueException
616 |  |
         {
617 | 0 |
             return copyInto(copyObj, true);
618 |  |
         }
619 |  |
620 |  |
621 |  |
         /**
622 |  |
          * Fills the copyObj with the contents of this object using connection.
623 |  |
          * The associated objects are also copied and treated as new objects.
624 |  |
          *
625 |  |
          * @param copyObj the object to fill.
626 |  |
          * @param con the database connection to read associated objects.
627 |  |
          */
628 |  |
         protected TurbineRolePermission copyInto(TurbineRolePermission copyObj, Connection con) throws TorqueException
629 |  |
         {
630 | 0 |
             return copyInto(copyObj, true, con);
631 |  |
         }
632 |  |
633 |  |
         /**
634 |  |
          * Fills the copyObj with the contents of this object.
635 |  |
          * If deepcopy is true, The associated objects are also copied
636 |  |
          * and treated as new objects.
637 |  |
          *
638 |  |
          * @param copyObj the object to fill.
639 |  |
          * @param deepcopy whether the associated objects should be copied.
640 |  |
          */
641 |  |
         protected TurbineRolePermission copyInto(TurbineRolePermission copyObj, boolean deepcopy) throws TorqueException
642 |  |
         {
643 | 0 |
             copyObj.setRoleId(roleId);
644 | 0 |
             copyObj.setPermissionId(permissionId);
645 |  |
646 | 0 |
             copyObj.setRoleId( 0);
647 | 0 |
             copyObj.setPermissionId( 0);
648 |  |
649 | 0 |
             if (deepcopy)
650 |  |
             {
651 |  |
             }
652 | 0 |
             return copyObj;
653 |  |
         }
654 |  |
655 |  |
656 |  |
         /**
657 |  |
          * Fills the copyObj with the contents of this object using connection.
658 |  |
          * If deepcopy is true, The associated objects are also copied
659 |  |
          * and treated as new objects.
660 |  |
          *
661 |  |
          * @param copyObj the object to fill.
662 |  |
          * @param deepcopy whether the associated objects should be copied.
663 |  |
          * @param con the database connection to read associated objects.
664 |  |
          */
665 |  |
         protected TurbineRolePermission copyInto(TurbineRolePermission copyObj, boolean deepcopy, Connection con) throws TorqueException
666 |  |
         {
667 | 0 |
             copyObj.setRoleId(roleId);
668 | 0 |
             copyObj.setPermissionId(permissionId);
669 |  |
670 | 0 |
             copyObj.setRoleId( 0);
671 | 0 |
             copyObj.setPermissionId( 0);
672 |  |
673 | 0 |
             if (deepcopy)
674 |  |
             {
675 |  |
             }
676 | 0 |
             return copyObj;
677 |  |
         }
678 |  |
679 |  |
680 |  |
681 |  |
         /**
682 |  |
          * returns a peer instance associated with this om.  Since Peer classes
683 |  |
          * are not to have any instance attributes, this method returns the
684 |  |
          * same instance for all member of this class. The method could therefore
685 |  |
          * be static, but this would prevent one from overriding the behavior.
686 |  |
          */
687 |  |
         public TurbineRolePermissionPeer getPeer()
688 |  |
         {
689 | 0 |
             return peer;
690 |  |
         }
691 |  |
692 |  |
         /**
693 |  |
          * Retrieves the TableMap object related to this Table data without
694 |  |
          * compiler warnings of using getPeer().getTableMap().
695 |  |
          *
696 |  |
          * @return The associated TableMap object.
697 |  |
          */
698 |  |
         public TableMap getTableMap() throws TorqueException
699 |  |
         {
700 | 0 |
             return TurbineRolePermissionPeer.getTableMap();
701 |  |
         }
702 |  |
703 |  |
704 |  |
         public String toString()
705 |  |
         {
706 | 0 |
             StringBuffer str = new StringBuffer();
707 | 0 |
             str.append("TurbineRolePermission:\n");
708 | 0 |
             str.append("RoleId = ")
709 |  |
                .append(getRoleId())
710 |  |
                .append("\n");
711 | 0 |
             str.append("PermissionId = ")
712 |  |
                .append(getPermissionId())
713 |  |
                .append("\n");
714 | 0 |
             return(str.toString());
715 |  |
         }
716 |  |
     }