1packageorg.apache.jetspeed.om.security.turbine;
234import java.math.BigDecimal;
5import java.sql.Connection;
6import java.util.ArrayList;
7import java.util.Collections;
8import java.util.Date;
9import java.util.List;
1011import org.apache.commons.lang.ObjectUtils;
12import org.apache.torque.TorqueException;
13import org.apache.torque.om.BaseObject;
14import org.apache.torque.om.ComboKey;
15import org.apache.torque.om.DateKey;
16import org.apache.torque.om.NumberKey;
17import org.apache.torque.om.ObjectKey;
18import org.apache.torque.om.SimpleKey;
19import org.apache.torque.om.StringKey;
20import org.apache.torque.om.Persistent;
21import org.apache.torque.util.Criteria;
22import org.apache.torque.util.Transaction;
232425/***26 * This class was autogenerated by Torque on:27 *28 * [Thu Apr 22 23:12:36 EDT 2004]29 *30 * You should not use this class directly. It should not even be31 * extended all references should be to TurbineRole32 */33publicabstractclassBaseTurbineRoleextends BaseObject
34 {
35/*** The Peer class */36privatestaticfinalTurbineRolePeer peer =
37newTurbineRolePeer();
383940/*** The value for the roleId field */41privateint roleId;
4243/*** The value for the roleName field */44private String roleName;
4546/*** The value for the objectdata field */47private byte[] objectdata;
484950/***51 * Get the RoleId52 * @return int53 */54publicint getRoleId()
55 {
56return roleId;
57 }
585960/***61 * Set the value of RoleId62 */63publicvoid setRoleId(int v ) throws TorqueException
64 {
6566if (this.roleId != v)
67 {
68this.roleId = v;
69 setModified(true);
70 }
71727374// update associated TurbineRolePermission75if (collTurbineRolePermissions != null )
76 {
77for (int i = 0; i < collTurbineRolePermissions.size(); i++)
78 {
79 ((TurbineRolePermission)collTurbineRolePermissions.get(i))
80 .setRoleId(v);
81 }
82 }
8384// update associated TurbineUserGroupRole85if (collTurbineUserGroupRoles != null )
86 {
87for (int i = 0; i < collTurbineUserGroupRoles.size(); i++)
88 {
89 ((TurbineUserGroupRole)collTurbineUserGroupRoles.get(i))
90 .setRoleId(v);
91 }
92 }
93 }
949596/***97 * Get the RoleName98 * @return String99 */100public String getRoleName()
101 {
102return roleName;
103 }
104105106/***107 * Set the value of RoleName108 */109publicvoid setRoleName(String v )
110 {
111112if (!ObjectUtils.equals(this.roleName, v))
113 {
114this.roleName = v;
115 setModified(true);
116 }
117118119 }
120121122/***123 * Get the Objectdata124 * @return byte[]125 */126public byte[] getObjectdata()
127 {
128return objectdata;
129 }
130131132/***133 * Set the value of Objectdata134 */135publicvoid setObjectdata(byte[] v )
136 {
137138if (!ObjectUtils.equals(this.objectdata, v))
139 {
140this.objectdata = v;
141 setModified(true);
142 }
143144145 }
146147148149150151/***152 * Collection to store aggregation of collTurbineRolePermissions153 */154protected List collTurbineRolePermissions;
155156/***157 * Temporary storage of collTurbineRolePermissions to save a possible db hit in158 * the event objects are add to the collection, but the159 * complete collection is never requested.160 */161protectedvoid initTurbineRolePermissions()
162 {
163if (collTurbineRolePermissions == null)
164 {
165 collTurbineRolePermissions = new ArrayList();
166 }
167 }
168169170/***171 * Method called to associate a TurbineRolePermission object to this object172 * through the TurbineRolePermission foreign key attribute173 *174 * @param TurbineRolePermission l175 */176publicvoid addTurbineRolePermission(TurbineRolePermission l) throws TorqueException
177 {
178 getTurbineRolePermissions().add(l);
179 l.setTurbineRole((TurbineRole)this);
180 }
181182/***183 * The criteria used to select the current contents of collTurbineRolePermissions184 */185private Criteria lastTurbineRolePermissionsCriteria = null;
186187/***188 * If this collection has already been initialized, returns189 * the collection. Otherwise returns the results of190 * getTurbineRolePermissions(new Criteria())191 */192public List getTurbineRolePermissions() throws TorqueException
193 {
194if (collTurbineRolePermissions == null)
195 {
196 collTurbineRolePermissions = getTurbineRolePermissions(new Criteria(10));
197 }
198return collTurbineRolePermissions;
199 }
200201/***202 * If this collection has already been initialized with203 * an identical criteria, it returns the collection.204 * Otherwise if this TurbineRole has previously205 * been saved, it will retrieve related TurbineRolePermissions from storage.206 * If this TurbineRole is new, it will return207 * an empty collection or the current collection, the criteria208 * is ignored on a new object.209 */210public List getTurbineRolePermissions(Criteria criteria) throws TorqueException
211 {
212if (collTurbineRolePermissions == null)
213 {
214if (isNew())
215 {
216 collTurbineRolePermissions = new ArrayList();
217 }
218else219 {
220 criteria.add(TurbineRolePermissionPeer.ROLE_ID, getRoleId() );
221 collTurbineRolePermissions = TurbineRolePermissionPeer.doSelect(criteria);
222 }
223 }
224else225 {
226// criteria has no effect for a new object227if (!isNew())
228 {
229// the following code is to determine if a new query is230// called for. If the criteria is the same as the last231// one, just return the collection.232 criteria.add(TurbineRolePermissionPeer.ROLE_ID, getRoleId() );
233if (!lastTurbineRolePermissionsCriteria.equals(criteria))
234 {
235 collTurbineRolePermissions = TurbineRolePermissionPeer.doSelect(criteria);
236 }
237 }
238 }
239 lastTurbineRolePermissionsCriteria = criteria;
240241return collTurbineRolePermissions;
242 }
243244/***245 * If this collection has already been initialized, returns246 * the collection. Otherwise returns the results of247 * getTurbineRolePermissions(new Criteria(),Connection)248 * This method takes in the Connection also as input so that249 * referenced objects can also be obtained using a Connection250 * that is taken as input251 */252public List getTurbineRolePermissions(Connection con) throws TorqueException
253 {
254if (collTurbineRolePermissions == null)
255 {
256 collTurbineRolePermissions = getTurbineRolePermissions(new Criteria(10),con);
257 }
258return collTurbineRolePermissions;
259 }
260261/***262 * If this collection has already been initialized with263 * an identical criteria, it returns the collection.264 * Otherwise if this TurbineRole has previously265 * been saved, it will retrieve related TurbineRolePermissions from storage.266 * If this TurbineRole is new, it will return267 * an empty collection or the current collection, the criteria268 * is ignored on a new object.269 * This method takes in the Connection also as input so that270 * referenced objects can also be obtained using a Connection271 * that is taken as input272 */273public List getTurbineRolePermissions(Criteria criteria,Connection con) throws TorqueException
274 {
275if (collTurbineRolePermissions == null)
276 {
277if (isNew())
278 {
279 collTurbineRolePermissions = new ArrayList();
280 }
281else282 {
283 criteria.add(TurbineRolePermissionPeer.ROLE_ID, getRoleId() );
284 collTurbineRolePermissions = TurbineRolePermissionPeer.doSelect(criteria,con);
285 }
286 }
287else288 {
289// criteria has no effect for a new object290if (!isNew())
291 {
292// the following code is to determine if a new query is293// called for. If the criteria is the same as the last294// one, just return the collection.295 criteria.add(TurbineRolePermissionPeer.ROLE_ID, getRoleId() );
296if (!lastTurbineRolePermissionsCriteria.equals(criteria))
297 {
298 collTurbineRolePermissions = TurbineRolePermissionPeer.doSelect(criteria,con);
299 }
300 }
301 }
302 lastTurbineRolePermissionsCriteria = criteria;
303304return collTurbineRolePermissions;
305 }
306307308309310311312313314315316317318/***319 * If this collection has already been initialized with320 * an identical criteria, it returns the collection.321 * Otherwise if this TurbineRole is new, it will return322 * an empty collection; or if this TurbineRole has previously323 * been saved, it will retrieve related TurbineRolePermissions from storage.324 *325 * This method is protected by default in order to keep the public326 * api reasonable. You can provide public methods for those you327 * actually need in TurbineRole.328 */329protected List getTurbineRolePermissionsJoinTurbineRole(Criteria criteria)
330 throws TorqueException
331 {
332if (collTurbineRolePermissions == null)
333 {
334if (isNew())
335 {
336 collTurbineRolePermissions = new ArrayList();
337 }
338else339 {
340 criteria.add(TurbineRolePermissionPeer.ROLE_ID, getRoleId() );
341 collTurbineRolePermissions = TurbineRolePermissionPeer.doSelectJoinTurbineRole(criteria);
342 }
343 }
344else345 {
346// the following code is to determine if a new query is347// called for. If the criteria is the same as the last348// one, just return the collection.349boolean newCriteria = true;
350 criteria.add(TurbineRolePermissionPeer.ROLE_ID, getRoleId() );
351if (!lastTurbineRolePermissionsCriteria.equals(criteria))
352 {
353 collTurbineRolePermissions = TurbineRolePermissionPeer.doSelectJoinTurbineRole(criteria);
354 }
355 }
356 lastTurbineRolePermissionsCriteria = criteria;
357358return collTurbineRolePermissions;
359 }
360361362363364365366367368369/***370 * If this collection has already been initialized with371 * an identical criteria, it returns the collection.372 * Otherwise if this TurbineRole is new, it will return373 * an empty collection; or if this TurbineRole has previously374 * been saved, it will retrieve related TurbineRolePermissions from storage.375 *376 * This method is protected by default in order to keep the public377 * api reasonable. You can provide public methods for those you378 * actually need in TurbineRole.379 */380protected List getTurbineRolePermissionsJoinTurbinePermission(Criteria criteria)
381 throws TorqueException
382 {
383if (collTurbineRolePermissions == null)
384 {
385if (isNew())
386 {
387 collTurbineRolePermissions = new ArrayList();
388 }
389else390 {
391 criteria.add(TurbineRolePermissionPeer.ROLE_ID, getRoleId() );
392 collTurbineRolePermissions = TurbineRolePermissionPeer.doSelectJoinTurbinePermission(criteria);
393 }
394 }
395else396 {
397// the following code is to determine if a new query is398// called for. If the criteria is the same as the last399// one, just return the collection.400boolean newCriteria = true;
401 criteria.add(TurbineRolePermissionPeer.ROLE_ID, getRoleId() );
402if (!lastTurbineRolePermissionsCriteria.equals(criteria))
403 {
404 collTurbineRolePermissions = TurbineRolePermissionPeer.doSelectJoinTurbinePermission(criteria);
405 }
406 }
407 lastTurbineRolePermissionsCriteria = criteria;
408409return collTurbineRolePermissions;
410 }
411412413414415416/***417 * Collection to store aggregation of collTurbineUserGroupRoles418 */419protected List collTurbineUserGroupRoles;
420421/***422 * Temporary storage of collTurbineUserGroupRoles to save a possible db hit in423 * the event objects are add to the collection, but the424 * complete collection is never requested.425 */426protectedvoid initTurbineUserGroupRoles()
427 {
428if (collTurbineUserGroupRoles == null)
429 {
430 collTurbineUserGroupRoles = new ArrayList();
431 }
432 }
433434435/***436 * Method called to associate a TurbineUserGroupRole object to this object437 * through the TurbineUserGroupRole foreign key attribute438 *439 * @param TurbineUserGroupRole l440 */441publicvoid addTurbineUserGroupRole(TurbineUserGroupRole l) throws TorqueException
442 {
443 getTurbineUserGroupRoles().add(l);
444 l.setTurbineRole((TurbineRole)this);
445 }
446447/***448 * The criteria used to select the current contents of collTurbineUserGroupRoles449 */450private Criteria lastTurbineUserGroupRolesCriteria = null;
451452/***453 * If this collection has already been initialized, returns454 * the collection. Otherwise returns the results of455 * getTurbineUserGroupRoles(new Criteria())456 */457public List getTurbineUserGroupRoles() throws TorqueException
458 {
459if (collTurbineUserGroupRoles == null)
460 {
461 collTurbineUserGroupRoles = getTurbineUserGroupRoles(new Criteria(10));
462 }
463return collTurbineUserGroupRoles;
464 }
465466/***467 * If this collection has already been initialized with468 * an identical criteria, it returns the collection.469 * Otherwise if this TurbineRole has previously470 * been saved, it will retrieve related TurbineUserGroupRoles from storage.471 * If this TurbineRole is new, it will return472 * an empty collection or the current collection, the criteria473 * is ignored on a new object.474 */475public List getTurbineUserGroupRoles(Criteria criteria) throws TorqueException
476 {
477if (collTurbineUserGroupRoles == null)
478 {
479if (isNew())
480 {
481 collTurbineUserGroupRoles = new ArrayList();
482 }
483else484 {
485 criteria.add(TurbineUserGroupRolePeer.ROLE_ID, getRoleId() );
486 collTurbineUserGroupRoles = TurbineUserGroupRolePeer.doSelect(criteria);
487 }
488 }
489else490 {
491// criteria has no effect for a new object492if (!isNew())
493 {
494// the following code is to determine if a new query is495// called for. If the criteria is the same as the last496// one, just return the collection.497 criteria.add(TurbineUserGroupRolePeer.ROLE_ID, getRoleId() );
498if (!lastTurbineUserGroupRolesCriteria.equals(criteria))
499 {
500 collTurbineUserGroupRoles = TurbineUserGroupRolePeer.doSelect(criteria);
501 }
502 }
503 }
504 lastTurbineUserGroupRolesCriteria = criteria;
505506return collTurbineUserGroupRoles;
507 }
508509/***510 * If this collection has already been initialized, returns511 * the collection. Otherwise returns the results of512 * getTurbineUserGroupRoles(new Criteria(),Connection)513 * This method takes in the Connection also as input so that514 * referenced objects can also be obtained using a Connection515 * that is taken as input516 */517public List getTurbineUserGroupRoles(Connection con) throws TorqueException
518 {
519if (collTurbineUserGroupRoles == null)
520 {
521 collTurbineUserGroupRoles = getTurbineUserGroupRoles(new Criteria(10),con);
522 }
523return collTurbineUserGroupRoles;
524 }
525526/***527 * If this collection has already been initialized with528 * an identical criteria, it returns the collection.529 * Otherwise if this TurbineRole has previously530 * been saved, it will retrieve related TurbineUserGroupRoles from storage.531 * If this TurbineRole is new, it will return532 * an empty collection or the current collection, the criteria533 * is ignored on a new object.534 * This method takes in the Connection also as input so that535 * referenced objects can also be obtained using a Connection536 * that is taken as input537 */538public List getTurbineUserGroupRoles(Criteria criteria,Connection con) throws TorqueException
539 {
540if (collTurbineUserGroupRoles == null)
541 {
542if (isNew())
543 {
544 collTurbineUserGroupRoles = new ArrayList();
545 }
546else547 {
548 criteria.add(TurbineUserGroupRolePeer.ROLE_ID, getRoleId() );
549 collTurbineUserGroupRoles = TurbineUserGroupRolePeer.doSelect(criteria,con);
550 }
551 }
552else553 {
554// criteria has no effect for a new object555if (!isNew())
556 {
557// the following code is to determine if a new query is558// called for. If the criteria is the same as the last559// one, just return the collection.560 criteria.add(TurbineUserGroupRolePeer.ROLE_ID, getRoleId() );
561if (!lastTurbineUserGroupRolesCriteria.equals(criteria))
562 {
563 collTurbineUserGroupRoles = TurbineUserGroupRolePeer.doSelect(criteria,con);
564 }
565 }
566 }
567 lastTurbineUserGroupRolesCriteria = criteria;
568569return collTurbineUserGroupRoles;
570 }
571572573574575576577578579580581582583/***584 * If this collection has already been initialized with585 * an identical criteria, it returns the collection.586 * Otherwise if this TurbineRole is new, it will return587 * an empty collection; or if this TurbineRole has previously588 * been saved, it will retrieve related TurbineUserGroupRoles from storage.589 *590 * This method is protected by default in order to keep the public591 * api reasonable. You can provide public methods for those you592 * actually need in TurbineRole.593 */594protected List getTurbineUserGroupRolesJoinTurbineUser(Criteria criteria)
595 throws TorqueException
596 {
597if (collTurbineUserGroupRoles == null)
598 {
599if (isNew())
600 {
601 collTurbineUserGroupRoles = new ArrayList();
602 }
603else604 {
605 criteria.add(TurbineUserGroupRolePeer.ROLE_ID, getRoleId() );
606 collTurbineUserGroupRoles = TurbineUserGroupRolePeer.doSelectJoinTurbineUser(criteria);
607 }
608 }
609else610 {
611// the following code is to determine if a new query is612// called for. If the criteria is the same as the last613// one, just return the collection.614boolean newCriteria = true;
615 criteria.add(TurbineUserGroupRolePeer.ROLE_ID, getRoleId() );
616if (!lastTurbineUserGroupRolesCriteria.equals(criteria))
617 {
618 collTurbineUserGroupRoles = TurbineUserGroupRolePeer.doSelectJoinTurbineUser(criteria);
619 }
620 }
621 lastTurbineUserGroupRolesCriteria = criteria;
622623return collTurbineUserGroupRoles;
624 }
625626627628629630631632633634/***635 * If this collection has already been initialized with636 * an identical criteria, it returns the collection.637 * Otherwise if this TurbineRole is new, it will return638 * an empty collection; or if this TurbineRole has previously639 * been saved, it will retrieve related TurbineUserGroupRoles from storage.640 *641 * This method is protected by default in order to keep the public642 * api reasonable. You can provide public methods for those you643 * actually need in TurbineRole.644 */645protected List getTurbineUserGroupRolesJoinTurbineGroup(Criteria criteria)
646 throws TorqueException
647 {
648if (collTurbineUserGroupRoles == null)
649 {
650if (isNew())
651 {
652 collTurbineUserGroupRoles = new ArrayList();
653 }
654else655 {
656 criteria.add(TurbineUserGroupRolePeer.ROLE_ID, getRoleId() );
657 collTurbineUserGroupRoles = TurbineUserGroupRolePeer.doSelectJoinTurbineGroup(criteria);
658 }
659 }
660else661 {
662// the following code is to determine if a new query is663// called for. If the criteria is the same as the last664// one, just return the collection.665boolean newCriteria = true;
666 criteria.add(TurbineUserGroupRolePeer.ROLE_ID, getRoleId() );
667if (!lastTurbineUserGroupRolesCriteria.equals(criteria))
668 {
669 collTurbineUserGroupRoles = TurbineUserGroupRolePeer.doSelectJoinTurbineGroup(criteria);
670 }
671 }
672 lastTurbineUserGroupRolesCriteria = criteria;
673674return collTurbineUserGroupRoles;
675 }
676677678679680681682683684685/***686 * If this collection has already been initialized with687 * an identical criteria, it returns the collection.688 * Otherwise if this TurbineRole is new, it will return689 * an empty collection; or if this TurbineRole has previously690 * been saved, it will retrieve related TurbineUserGroupRoles from storage.691 *692 * This method is protected by default in order to keep the public693 * api reasonable. You can provide public methods for those you694 * actually need in TurbineRole.695 */696protected List getTurbineUserGroupRolesJoinTurbineRole(Criteria criteria)
697 throws TorqueException
698 {
699if (collTurbineUserGroupRoles == null)
700 {
701if (isNew())
702 {
703 collTurbineUserGroupRoles = new ArrayList();
704 }
705else706 {
707 criteria.add(TurbineUserGroupRolePeer.ROLE_ID, getRoleId() );
708 collTurbineUserGroupRoles = TurbineUserGroupRolePeer.doSelectJoinTurbineRole(criteria);
709 }
710 }
711else712 {
713// the following code is to determine if a new query is714// called for. If the criteria is the same as the last715// one, just return the collection.716boolean newCriteria = true;
717 criteria.add(TurbineUserGroupRolePeer.ROLE_ID, getRoleId() );
718if (!lastTurbineUserGroupRolesCriteria.equals(criteria))
719 {
720 collTurbineUserGroupRoles = TurbineUserGroupRolePeer.doSelectJoinTurbineRole(criteria);
721 }
722 }
723 lastTurbineUserGroupRolesCriteria = criteria;
724725return collTurbineUserGroupRoles;
726 }
727728729730731privatestatic List fieldNames = null;
732733/***734 * Generate a list of field names.735 */736publicstaticsynchronized List getFieldNames()
737 {
738if (fieldNames == null)
739 {
740 fieldNames = new ArrayList();
741 fieldNames.add("RoleId");
742 fieldNames.add("RoleName");
743 fieldNames.add("Objectdata");
744 fieldNames = Collections.unmodifiableList(fieldNames);
745 }
746return fieldNames;
747 }
748749/***750 * Retrieves a field from the object by name passed in751 * as a String.752 */753public Object getByName(String name)
754 {
755if (name.equals("RoleId"))
756 {
757returnnew Integer(getRoleId());
758 }
759if (name.equals("RoleName"))
760 {
761return getRoleName();
762 }
763if (name.equals("Objectdata"))
764 {
765return getObjectdata();
766 }
767returnnull;
768 }
769770/***771 * Retrieves a field from the object by name passed in772 * as a String. The String must be one of the static773 * Strings defined in this Class' Peer.774 */775public Object getByPeerName(String name)
776 {
777if (name.equals(TurbineRolePeer.ROLE_ID ))
778 {
779returnnew Integer(getRoleId());
780 }
781if (name.equals(TurbineRolePeer.ROLE_NAME ))
782 {
783return getRoleName();
784 }
785if (name.equals(TurbineRolePeer.OBJECTDATA ))
786 {
787return getObjectdata();
788 }
789returnnull;
790 }
791792/***793 * Retrieves a field from the object by Position as specified794 * in the xml schema. Zero-based.795 */796public Object getByPosition(int pos)
797 {
798if ( pos == 0 )
799 {
800returnnew Integer(getRoleId());
801 }
802if ( pos == 1 )
803 {
804return getRoleName();
805 }
806if ( pos == 2 )
807 {
808return getObjectdata();
809 }
810returnnull;
811 }
812813/***814 * Stores the object in the database. If the object is new,815 * it inserts it; otherwise an update is performed.816 */817publicvoid save() throws Exception
818 {
819 save(TurbineRolePeer.getMapBuilder()
820 .getDatabaseMap().getName());
821 }
822823/***824 * Stores the object in the database. If the object is new,825 * it inserts it; otherwise an update is performed.826 * Note: this code is here because the method body is827 * auto-generated conditionally and therefore needs to be828 * in this file instead of in the super class, BaseObject.829 */830publicvoid save(String dbName) throws TorqueException
831 {
832 Connection con = null;
833try834 {
835 con = Transaction.begin(dbName);
836 save(con);
837 Transaction.commit(con);
838 }
839catch(TorqueException e)
840 {
841 Transaction.safeRollback(con);
842throw e;
843 }
844 }
845846/*** flag to prevent endless save loop, if this object is referenced847 by another object which falls in this transaction. */848privateboolean alreadyInSave = false;
849/***850 * Stores the object in the database. If the object is new,851 * it inserts it; otherwise an update is performed. This method852 * is meant to be used as part of a transaction, otherwise use853 * the save() method and the connection details will be handled854 * internally855 */856publicvoid save(Connection con) throws TorqueException
857 {
858if (!alreadyInSave)
859 {
860 alreadyInSave = true;
861862863864// If this object has been modified, then save it to the database.865if (isModified())
866 {
867if (isNew())
868 {
869 TurbineRolePeer.doInsert((TurbineRole)this, con);
870 setNew(false);
871 }
872else873 {
874 TurbineRolePeer.doUpdate((TurbineRole)this, con);
875 }
876877if (isCacheOnSave())
878 {
879 TurbineRoleManager.putInstance(this);
880 }
881 }
882883884if (collTurbineRolePermissions != null )
885 {
886for (int i = 0; i < collTurbineRolePermissions.size(); i++)
887 {
888 ((TurbineRolePermission)collTurbineRolePermissions.get(i)).save(con);
889 }
890 }
891892if (collTurbineUserGroupRoles != null )
893 {
894for (int i = 0; i < collTurbineUserGroupRoles.size(); i++)
895 {
896 ((TurbineUserGroupRole)collTurbineUserGroupRoles.get(i)).save(con);
897 }
898 }
899 alreadyInSave = false;
900 }
901 }
902903/***904 * Specify whether to cache the object after saving to the db.905 * This method returns false906 */907protectedboolean isCacheOnSave()
908 {
909returntrue;
910 }
911912913/***914 * Set the PrimaryKey using ObjectKey.915 *916 * @param ObjectKey roleId917 */918publicvoid setPrimaryKey(ObjectKey roleId)
919 throws TorqueException {
920 setRoleId(((NumberKey)roleId).intValue());
921 }
922923/***924 * Set the PrimaryKey using a String.925 */926publicvoid setPrimaryKey(String key) throws TorqueException
927 {
928 setRoleId(Integer.parseInt(key));
929 }
930931932/***933 * returns an id that differentiates this object from others934 * of its class.935 */936public ObjectKey getPrimaryKey()
937 {
938return SimpleKey.keyFor(getRoleId());
939 }
940941942/***943 * Makes a copy of this object.944 * It creates a new object filling in the simple attributes.945 * It then fills all the association collections.946 */947publicTurbineRole copy() throws TorqueException
948 {
949TurbineRole copyObj = newTurbineRole();
950 copyObj.setRoleId(roleId);
951 copyObj.setRoleName(roleName);
952 copyObj.setObjectdata(objectdata);
953954 copyObj.setRoleId(0);
955956957958 List v = getTurbineRolePermissions();
959for (int i = 0; i < v.size(); i++)
960 {
961TurbineRolePermission obj = (TurbineRolePermission) v.get(i);
962 copyObj.addTurbineRolePermission(obj.copy());
963 }
964965966 v = getTurbineUserGroupRoles();
967for (int i = 0; i < v.size(); i++)
968 {
969TurbineUserGroupRole obj = (TurbineUserGroupRole) v.get(i);
970 copyObj.addTurbineUserGroupRole(obj.copy());
971 }
972return copyObj;
973 }
974975/***976 * returns a peer instance associated with this om. Since Peer classes977 * are not to have any instance attributes, this method returns the978 * same instance for all member of this class. The method could therefore979 * be static, but this would prevent one from overriding the behavior.980 */981publicTurbineRolePeer getPeer()
982 {
983return peer;
984 }
985 }