1packageorg.apache.jetspeed.om.dbregistry;
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 PortletDbEntry32 */33publicabstractclassBasePortletDbEntryextends BaseObject
34 {
35/*** The Peer class */36privatestaticfinalPortletDbEntryPeer peer =
37newPortletDbEntryPeer();
383940/*** The value for the id field */41privatelong id;
4243/*** The value for the name field */44private String name;
4546/*** The value for the hidden field */47privateboolean hidden=false;
4849/*** The value for the classname field */50private String classname;
5152/*** The value for the type field */53private String type;
5455/*** The value for the application field */56privateboolean application=false;
5758/*** The value for the parentRef field */59privatelong parentRef;
6061/*** The value for the uRL field */62private String uRL;
6364/*** The value for the cachedonurl field */65privateboolean cachedonurl=true;
6667/*** The value for the role field */68private String role;
6970/*** The value for the title field */71private String title;
7273/*** The value for the description field */74private String description;
7576/*** The value for the image field */77private String image;
7879/*** The value for the securityRef field */80private String securityRef;
818283/***84 * Get the Id85 * @return long86 */87publiclong getId()
88 {
89return id;
90 }
919293/***94 * Set the value of Id95 */96publicvoid setId(long v ) throws TorqueException
97 {
9899if (this.id != v)
100 {
101this.id = v;
102 setModified(true);
103 }
104105106107// update associated PortletCategory108if (collPortletCategorys != null )
109 {
110for (int i = 0; i < collPortletCategorys.size(); i++)
111 {
112 ((PortletCategory)collPortletCategorys.get(i))
113 .setOwner(v);
114 }
115 }
116117// update associated PortletParameter118if (collPortletParameters != null )
119 {
120for (int i = 0; i < collPortletParameters.size(); i++)
121 {
122 ((PortletParameter)collPortletParameters.get(i))
123 .setPortletId(v);
124 }
125 }
126127// update associated PortletMediatype128if (collPortletMediatypes != null )
129 {
130for (int i = 0; i < collPortletMediatypes.size(); i++)
131 {
132 ((PortletMediatype)collPortletMediatypes.get(i))
133 .setId(v);
134 }
135 }
136 }
137138139/***140 * Get the Name141 * @return String142 */143public String getName()
144 {
145return name;
146 }
147148149/***150 * Set the value of Name151 */152publicvoid setName(String v )
153 {
154155if (!ObjectUtils.equals(this.name, v))
156 {
157this.name = v;
158 setModified(true);
159 }
160161162 }
163164165/***166 * Get the Hidden167 * @return boolean168 */169publicboolean getHidden()
170 {
171return hidden;
172 }
173174175/***176 * Set the value of Hidden177 */178publicvoid setHidden(boolean v )
179 {
180181if (this.hidden != v)
182 {
183this.hidden = v;
184 setModified(true);
185 }
186187188 }
189190191/***192 * Get the Classname193 * @return String194 */195public String getClassname()
196 {
197return classname;
198 }
199200201/***202 * Set the value of Classname203 */204publicvoid setClassname(String v )
205 {
206207if (!ObjectUtils.equals(this.classname, v))
208 {
209this.classname = v;
210 setModified(true);
211 }
212213214 }
215216217/***218 * Get the Type219 * @return String220 */221public String getType()
222 {
223return type;
224 }
225226227/***228 * Set the value of Type229 */230publicvoid setType(String v )
231 {
232233if (!ObjectUtils.equals(this.type, v))
234 {
235this.type = v;
236 setModified(true);
237 }
238239240 }
241242243/***244 * Get the Application245 * @return boolean246 */247publicboolean getApplication()
248 {
249return application;
250 }
251252253/***254 * Set the value of Application255 */256publicvoid setApplication(boolean v )
257 {
258259if (this.application != v)
260 {
261this.application = v;
262 setModified(true);
263 }
264265266 }
267268269/***270 * Get the ParentRef271 * @return long272 */273publiclong getParentRef()
274 {
275return parentRef;
276 }
277278279/***280 * Set the value of ParentRef281 */282publicvoid setParentRef(long v )
283 {
284285if (this.parentRef != v)
286 {
287this.parentRef = v;
288 setModified(true);
289 }
290291292 }
293294295/***296 * Get the URL297 * @return String298 */299public String getURL()
300 {
301return uRL;
302 }
303304305/***306 * Set the value of URL307 */308publicvoid setURL(String v )
309 {
310311if (!ObjectUtils.equals(this.uRL, v))
312 {
313this.uRL = v;
314 setModified(true);
315 }
316317318 }
319320321/***322 * Get the Cachedonurl323 * @return boolean324 */325publicboolean getCachedonurl()
326 {
327return cachedonurl;
328 }
329330331/***332 * Set the value of Cachedonurl333 */334publicvoid setCachedonurl(boolean v )
335 {
336337if (this.cachedonurl != v)
338 {
339this.cachedonurl = v;
340 setModified(true);
341 }
342343344 }
345346347/***348 * Get the Role349 * @return String350 */351public String getRole()
352 {
353return role;
354 }
355356357/***358 * Set the value of Role359 */360publicvoid setRole(String v )
361 {
362363if (!ObjectUtils.equals(this.role, v))
364 {
365this.role = v;
366 setModified(true);
367 }
368369370 }
371372373/***374 * Get the Title375 * @return String376 */377public String getTitle()
378 {
379return title;
380 }
381382383/***384 * Set the value of Title385 */386publicvoid setTitle(String v )
387 {
388389if (!ObjectUtils.equals(this.title, v))
390 {
391this.title = v;
392 setModified(true);
393 }
394395396 }
397398399/***400 * Get the Description401 * @return String402 */403public String getDescription()
404 {
405return description;
406 }
407408409/***410 * Set the value of Description411 */412publicvoid setDescription(String v )
413 {
414415if (!ObjectUtils.equals(this.description, v))
416 {
417this.description = v;
418 setModified(true);
419 }
420421422 }
423424425/***426 * Get the Image427 * @return String428 */429public String getImage()
430 {
431return image;
432 }
433434435/***436 * Set the value of Image437 */438publicvoid setImage(String v )
439 {
440441if (!ObjectUtils.equals(this.image, v))
442 {
443this.image = v;
444 setModified(true);
445 }
446447448 }
449450451/***452 * Get the SecurityRef453 * @return String454 */455public String getSecurityRef()
456 {
457return securityRef;
458 }
459460461/***462 * Set the value of SecurityRef463 */464publicvoid setSecurityRef(String v )
465 {
466467if (!ObjectUtils.equals(this.securityRef, v))
468 {
469this.securityRef = v;
470 setModified(true);
471 }
472473474 }
475476477478479480/***481 * Collection to store aggregation of collPortletCategorys482 */483protected List collPortletCategorys;
484485/***486 * Temporary storage of collPortletCategorys to save a possible db hit in487 * the event objects are add to the collection, but the488 * complete collection is never requested.489 */490protectedvoid initPortletCategorys()
491 {
492if (collPortletCategorys == null)
493 {
494 collPortletCategorys = new ArrayList();
495 }
496 }
497498499/***500 * Method called to associate a PortletCategory object to this object501 * through the PortletCategory foreign key attribute502 *503 * @param PortletCategory l504 */505publicvoid addPortletCategory(PortletCategory l) throws TorqueException
506 {
507 getPortletCategorys().add(l);
508 l.setPortletDbEntry((PortletDbEntry)this);
509 }
510511/***512 * The criteria used to select the current contents of collPortletCategorys513 */514private Criteria lastPortletCategorysCriteria = null;
515516/***517 * If this collection has already been initialized, returns518 * the collection. Otherwise returns the results of519 * getPortletCategorys(new Criteria())520 */521public List getPortletCategorys() throws TorqueException
522 {
523if (collPortletCategorys == null)
524 {
525 collPortletCategorys = getPortletCategorys(new Criteria(10));
526 }
527return collPortletCategorys;
528 }
529530/***531 * If this collection has already been initialized with532 * an identical criteria, it returns the collection.533 * Otherwise if this PortletDbEntry has previously534 * been saved, it will retrieve related PortletCategorys from storage.535 * If this PortletDbEntry is new, it will return536 * an empty collection or the current collection, the criteria537 * is ignored on a new object.538 */539public List getPortletCategorys(Criteria criteria) throws TorqueException
540 {
541if (collPortletCategorys == null)
542 {
543if (isNew())
544 {
545 collPortletCategorys = new ArrayList();
546 }
547else548 {
549 criteria.add(PortletCategoryPeer.OWNER, getId() );
550 collPortletCategorys = PortletCategoryPeer.doSelect(criteria);
551 }
552 }
553else554 {
555// criteria has no effect for a new object556if (!isNew())
557 {
558// the following code is to determine if a new query is559// called for. If the criteria is the same as the last560// one, just return the collection.561 criteria.add(PortletCategoryPeer.OWNER, getId() );
562if (!lastPortletCategorysCriteria.equals(criteria))
563 {
564 collPortletCategorys = PortletCategoryPeer.doSelect(criteria);
565 }
566 }
567 }
568 lastPortletCategorysCriteria = criteria;
569570return collPortletCategorys;
571 }
572573/***574 * If this collection has already been initialized, returns575 * the collection. Otherwise returns the results of576 * getPortletCategorys(new Criteria(),Connection)577 * This method takes in the Connection also as input so that578 * referenced objects can also be obtained using a Connection579 * that is taken as input580 */581public List getPortletCategorys(Connection con) throws TorqueException
582 {
583if (collPortletCategorys == null)
584 {
585 collPortletCategorys = getPortletCategorys(new Criteria(10),con);
586 }
587return collPortletCategorys;
588 }
589590/***591 * If this collection has already been initialized with592 * an identical criteria, it returns the collection.593 * Otherwise if this PortletDbEntry has previously594 * been saved, it will retrieve related PortletCategorys from storage.595 * If this PortletDbEntry is new, it will return596 * an empty collection or the current collection, the criteria597 * is ignored on a new object.598 * This method takes in the Connection also as input so that599 * referenced objects can also be obtained using a Connection600 * that is taken as input601 */602public List getPortletCategorys(Criteria criteria,Connection con) throws TorqueException
603 {
604if (collPortletCategorys == null)
605 {
606if (isNew())
607 {
608 collPortletCategorys = new ArrayList();
609 }
610else611 {
612 criteria.add(PortletCategoryPeer.OWNER, getId() );
613 collPortletCategorys = PortletCategoryPeer.doSelect(criteria,con);
614 }
615 }
616else617 {
618// criteria has no effect for a new object619if (!isNew())
620 {
621// the following code is to determine if a new query is622// called for. If the criteria is the same as the last623// one, just return the collection.624 criteria.add(PortletCategoryPeer.OWNER, getId() );
625if (!lastPortletCategorysCriteria.equals(criteria))
626 {
627 collPortletCategorys = PortletCategoryPeer.doSelect(criteria,con);
628 }
629 }
630 }
631 lastPortletCategorysCriteria = criteria;
632633return collPortletCategorys;
634 }
635636637638639640641642643644645646647/***648 * If this collection has already been initialized with649 * an identical criteria, it returns the collection.650 * Otherwise if this PortletDbEntry is new, it will return651 * an empty collection; or if this PortletDbEntry has previously652 * been saved, it will retrieve related PortletCategorys from storage.653 *654 * This method is protected by default in order to keep the public655 * api reasonable. You can provide public methods for those you656 * actually need in PortletDbEntry.657 */658protected List getPortletCategorysJoinPortletDbEntry(Criteria criteria)
659 throws TorqueException
660 {
661if (collPortletCategorys == null)
662 {
663if (isNew())
664 {
665 collPortletCategorys = new ArrayList();
666 }
667else668 {
669 criteria.add(PortletCategoryPeer.OWNER, getId() );
670 collPortletCategorys = PortletCategoryPeer.doSelectJoinPortletDbEntry(criteria);
671 }
672 }
673else674 {
675// the following code is to determine if a new query is676// called for. If the criteria is the same as the last677// one, just return the collection.678boolean newCriteria = true;
679 criteria.add(PortletCategoryPeer.OWNER, getId() );
680if (!lastPortletCategorysCriteria.equals(criteria))
681 {
682 collPortletCategorys = PortletCategoryPeer.doSelectJoinPortletDbEntry(criteria);
683 }
684 }
685 lastPortletCategorysCriteria = criteria;
686687return collPortletCategorys;
688 }
689690691692693694/***695 * Collection to store aggregation of collPortletParameters696 */697protected List collPortletParameters;
698699/***700 * Temporary storage of collPortletParameters to save a possible db hit in701 * the event objects are add to the collection, but the702 * complete collection is never requested.703 */704protectedvoid initPortletParameters()
705 {
706if (collPortletParameters == null)
707 {
708 collPortletParameters = new ArrayList();
709 }
710 }
711712713/***714 * Method called to associate a PortletParameter object to this object715 * through the PortletParameter foreign key attribute716 *717 * @param PortletParameter l718 */719publicvoid addPortletParameter(PortletParameter l) throws TorqueException
720 {
721 getPortletParameters().add(l);
722 l.setPortletDbEntry((PortletDbEntry)this);
723 }
724725/***726 * The criteria used to select the current contents of collPortletParameters727 */728private Criteria lastPortletParametersCriteria = null;
729730/***731 * If this collection has already been initialized, returns732 * the collection. Otherwise returns the results of733 * getPortletParameters(new Criteria())734 */735public List getPortletParameters() throws TorqueException
736 {
737if (collPortletParameters == null)
738 {
739 collPortletParameters = getPortletParameters(new Criteria(10));
740 }
741return collPortletParameters;
742 }
743744/***745 * If this collection has already been initialized with746 * an identical criteria, it returns the collection.747 * Otherwise if this PortletDbEntry has previously748 * been saved, it will retrieve related PortletParameters from storage.749 * If this PortletDbEntry is new, it will return750 * an empty collection or the current collection, the criteria751 * is ignored on a new object.752 */753public List getPortletParameters(Criteria criteria) throws TorqueException
754 {
755if (collPortletParameters == null)
756 {
757if (isNew())
758 {
759 collPortletParameters = new ArrayList();
760 }
761else762 {
763 criteria.add(PortletParameterPeer.PORTLET_ID, getId() );
764 collPortletParameters = PortletParameterPeer.doSelect(criteria);
765 }
766 }
767else768 {
769// criteria has no effect for a new object770if (!isNew())
771 {
772// the following code is to determine if a new query is773// called for. If the criteria is the same as the last774// one, just return the collection.775 criteria.add(PortletParameterPeer.PORTLET_ID, getId() );
776if (!lastPortletParametersCriteria.equals(criteria))
777 {
778 collPortletParameters = PortletParameterPeer.doSelect(criteria);
779 }
780 }
781 }
782 lastPortletParametersCriteria = criteria;
783784return collPortletParameters;
785 }
786787/***788 * If this collection has already been initialized, returns789 * the collection. Otherwise returns the results of790 * getPortletParameters(new Criteria(),Connection)791 * This method takes in the Connection also as input so that792 * referenced objects can also be obtained using a Connection793 * that is taken as input794 */795public List getPortletParameters(Connection con) throws TorqueException
796 {
797if (collPortletParameters == null)
798 {
799 collPortletParameters = getPortletParameters(new Criteria(10),con);
800 }
801return collPortletParameters;
802 }
803804/***805 * If this collection has already been initialized with806 * an identical criteria, it returns the collection.807 * Otherwise if this PortletDbEntry has previously808 * been saved, it will retrieve related PortletParameters from storage.809 * If this PortletDbEntry is new, it will return810 * an empty collection or the current collection, the criteria811 * is ignored on a new object.812 * This method takes in the Connection also as input so that813 * referenced objects can also be obtained using a Connection814 * that is taken as input815 */816public List getPortletParameters(Criteria criteria,Connection con) throws TorqueException
817 {
818if (collPortletParameters == null)
819 {
820if (isNew())
821 {
822 collPortletParameters = new ArrayList();
823 }
824else825 {
826 criteria.add(PortletParameterPeer.PORTLET_ID, getId() );
827 collPortletParameters = PortletParameterPeer.doSelect(criteria,con);
828 }
829 }
830else831 {
832// criteria has no effect for a new object833if (!isNew())
834 {
835// the following code is to determine if a new query is836// called for. If the criteria is the same as the last837// one, just return the collection.838 criteria.add(PortletParameterPeer.PORTLET_ID, getId() );
839if (!lastPortletParametersCriteria.equals(criteria))
840 {
841 collPortletParameters = PortletParameterPeer.doSelect(criteria,con);
842 }
843 }
844 }
845 lastPortletParametersCriteria = criteria;
846847return collPortletParameters;
848 }
849850851852853854855856857858859860861/***862 * If this collection has already been initialized with863 * an identical criteria, it returns the collection.864 * Otherwise if this PortletDbEntry is new, it will return865 * an empty collection; or if this PortletDbEntry has previously866 * been saved, it will retrieve related PortletParameters from storage.867 *868 * This method is protected by default in order to keep the public869 * api reasonable. You can provide public methods for those you870 * actually need in PortletDbEntry.871 */872protected List getPortletParametersJoinPortletDbEntry(Criteria criteria)
873 throws TorqueException
874 {
875if (collPortletParameters == null)
876 {
877if (isNew())
878 {
879 collPortletParameters = new ArrayList();
880 }
881else882 {
883 criteria.add(PortletParameterPeer.PORTLET_ID, getId() );
884 collPortletParameters = PortletParameterPeer.doSelectJoinPortletDbEntry(criteria);
885 }
886 }
887else888 {
889// the following code is to determine if a new query is890// called for. If the criteria is the same as the last891// one, just return the collection.892boolean newCriteria = true;
893 criteria.add(PortletParameterPeer.PORTLET_ID, getId() );
894if (!lastPortletParametersCriteria.equals(criteria))
895 {
896 collPortletParameters = PortletParameterPeer.doSelectJoinPortletDbEntry(criteria);
897 }
898 }
899 lastPortletParametersCriteria = criteria;
900901return collPortletParameters;
902 }
903904905906907908/***909 * Collection to store aggregation of collPortletMediatypes910 */911protected List collPortletMediatypes;
912913/***914 * Temporary storage of collPortletMediatypes to save a possible db hit in915 * the event objects are add to the collection, but the916 * complete collection is never requested.917 */918protectedvoid initPortletMediatypes()
919 {
920if (collPortletMediatypes == null)
921 {
922 collPortletMediatypes = new ArrayList();
923 }
924 }
925926927/***928 * Method called to associate a PortletMediatype object to this object929 * through the PortletMediatype foreign key attribute930 *931 * @param PortletMediatype l932 */933publicvoid addPortletMediatype(PortletMediatype l) throws TorqueException
934 {
935 getPortletMediatypes().add(l);
936 l.setPortletDbEntry((PortletDbEntry)this);
937 }
938939/***940 * The criteria used to select the current contents of collPortletMediatypes941 */942private Criteria lastPortletMediatypesCriteria = null;
943944/***945 * If this collection has already been initialized, returns946 * the collection. Otherwise returns the results of947 * getPortletMediatypes(new Criteria())948 */949public List getPortletMediatypes() throws TorqueException
950 {
951if (collPortletMediatypes == null)
952 {
953 collPortletMediatypes = getPortletMediatypes(new Criteria(10));
954 }
955return collPortletMediatypes;
956 }
957958/***959 * If this collection has already been initialized with960 * an identical criteria, it returns the collection.961 * Otherwise if this PortletDbEntry has previously962 * been saved, it will retrieve related PortletMediatypes from storage.963 * If this PortletDbEntry is new, it will return964 * an empty collection or the current collection, the criteria965 * is ignored on a new object.966 */967public List getPortletMediatypes(Criteria criteria) throws TorqueException
968 {
969if (collPortletMediatypes == null)
970 {
971if (isNew())
972 {
973 collPortletMediatypes = new ArrayList();
974 }
975else976 {
977 criteria.add(PortletMediatypePeer.ID, getId() );
978 collPortletMediatypes = PortletMediatypePeer.doSelect(criteria);
979 }
980 }
981else982 {
983// criteria has no effect for a new object984if (!isNew())
985 {
986// the following code is to determine if a new query is987// called for. If the criteria is the same as the last988// one, just return the collection.989 criteria.add(PortletMediatypePeer.ID, getId() );
990if (!lastPortletMediatypesCriteria.equals(criteria))
991 {
992 collPortletMediatypes = PortletMediatypePeer.doSelect(criteria);
993 }
994 }
995 }
996 lastPortletMediatypesCriteria = criteria;
997998return collPortletMediatypes;
999 }
10001001/***1002 * If this collection has already been initialized, returns1003 * the collection. Otherwise returns the results of1004 * getPortletMediatypes(new Criteria(),Connection)1005 * This method takes in the Connection also as input so that1006 * referenced objects can also be obtained using a Connection1007 * that is taken as input1008 */1009public List getPortletMediatypes(Connection con) throws TorqueException
1010 {
1011if (collPortletMediatypes == null)
1012 {
1013 collPortletMediatypes = getPortletMediatypes(new Criteria(10),con);
1014 }
1015return collPortletMediatypes;
1016 }
10171018/***1019 * If this collection has already been initialized with1020 * an identical criteria, it returns the collection.1021 * Otherwise if this PortletDbEntry has previously1022 * been saved, it will retrieve related PortletMediatypes from storage.1023 * If this PortletDbEntry is new, it will return1024 * an empty collection or the current collection, the criteria1025 * is ignored on a new object.1026 * This method takes in the Connection also as input so that1027 * referenced objects can also be obtained using a Connection1028 * that is taken as input1029 */1030public List getPortletMediatypes(Criteria criteria,Connection con) throws TorqueException
1031 {
1032if (collPortletMediatypes == null)
1033 {
1034if (isNew())
1035 {
1036 collPortletMediatypes = new ArrayList();
1037 }
1038else1039 {
1040 criteria.add(PortletMediatypePeer.ID, getId() );
1041 collPortletMediatypes = PortletMediatypePeer.doSelect(criteria,con);
1042 }
1043 }
1044else1045 {
1046// criteria has no effect for a new object1047if (!isNew())
1048 {
1049// the following code is to determine if a new query is1050// called for. If the criteria is the same as the last1051// one, just return the collection.1052 criteria.add(PortletMediatypePeer.ID, getId() );
1053if (!lastPortletMediatypesCriteria.equals(criteria))
1054 {
1055 collPortletMediatypes = PortletMediatypePeer.doSelect(criteria,con);
1056 }
1057 }
1058 }
1059 lastPortletMediatypesCriteria = criteria;
10601061return collPortletMediatypes;
1062 }
1063106410651066106710681069107010711072107310741075/***1076 * If this collection has already been initialized with1077 * an identical criteria, it returns the collection.1078 * Otherwise if this PortletDbEntry is new, it will return1079 * an empty collection; or if this PortletDbEntry has previously1080 * been saved, it will retrieve related PortletMediatypes from storage.1081 *1082 * This method is protected by default in order to keep the public1083 * api reasonable. You can provide public methods for those you1084 * actually need in PortletDbEntry.1085 */1086protected List getPortletMediatypesJoinPortletDbEntry(Criteria criteria)
1087 throws TorqueException
1088 {
1089if (collPortletMediatypes == null)
1090 {
1091if (isNew())
1092 {
1093 collPortletMediatypes = new ArrayList();
1094 }
1095else1096 {
1097 criteria.add(PortletMediatypePeer.ID, getId() );
1098 collPortletMediatypes = PortletMediatypePeer.doSelectJoinPortletDbEntry(criteria);
1099 }
1100 }
1101else1102 {
1103// the following code is to determine if a new query is1104// called for. If the criteria is the same as the last1105// one, just return the collection.1106boolean newCriteria = true;
1107 criteria.add(PortletMediatypePeer.ID, getId() );
1108if (!lastPortletMediatypesCriteria.equals(criteria))
1109 {
1110 collPortletMediatypes = PortletMediatypePeer.doSelectJoinPortletDbEntry(criteria);
1111 }
1112 }
1113 lastPortletMediatypesCriteria = criteria;
11141115return collPortletMediatypes;
1116 }
1117111811191120112111221123112411251126/***1127 * If this collection has already been initialized with1128 * an identical criteria, it returns the collection.1129 * Otherwise if this PortletDbEntry is new, it will return1130 * an empty collection; or if this PortletDbEntry has previously1131 * been saved, it will retrieve related PortletMediatypes from storage.1132 *1133 * This method is protected by default in order to keep the public1134 * api reasonable. You can provide public methods for those you1135 * actually need in PortletDbEntry.1136 */1137protected List getPortletMediatypesJoinMediatype(Criteria criteria)
1138 throws TorqueException
1139 {
1140if (collPortletMediatypes == null)
1141 {
1142if (isNew())
1143 {
1144 collPortletMediatypes = new ArrayList();
1145 }
1146else1147 {
1148 criteria.add(PortletMediatypePeer.ID, getId() );
1149 collPortletMediatypes = PortletMediatypePeer.doSelectJoinMediatype(criteria);
1150 }
1151 }
1152else1153 {
1154// the following code is to determine if a new query is1155// called for. If the criteria is the same as the last1156// one, just return the collection.1157boolean newCriteria = true;
1158 criteria.add(PortletMediatypePeer.ID, getId() );
1159if (!lastPortletMediatypesCriteria.equals(criteria))
1160 {
1161 collPortletMediatypes = PortletMediatypePeer.doSelectJoinMediatype(criteria);
1162 }
1163 }
1164 lastPortletMediatypesCriteria = criteria;
11651166return collPortletMediatypes;
1167 }
11681169117011711172privatestatic List fieldNames = null;
11731174/***1175 * Generate a list of field names.1176 */1177publicstaticsynchronized List getFieldNames()
1178 {
1179if (fieldNames == null)
1180 {
1181 fieldNames = new ArrayList();
1182 fieldNames.add("Id");
1183 fieldNames.add("Name");
1184 fieldNames.add("Hidden");
1185 fieldNames.add("Classname");
1186 fieldNames.add("Type");
1187 fieldNames.add("Application");
1188 fieldNames.add("ParentRef");
1189 fieldNames.add("URL");
1190 fieldNames.add("Cachedonurl");
1191 fieldNames.add("Role");
1192 fieldNames.add("Title");
1193 fieldNames.add("Description");
1194 fieldNames.add("Image");
1195 fieldNames.add("SecurityRef");
1196 fieldNames = Collections.unmodifiableList(fieldNames);
1197 }
1198return fieldNames;
1199 }
12001201/***1202 * Retrieves a field from the object by name passed in1203 * as a String.1204 */1205public Object getByName(String name)
1206 {
1207if (name.equals("Id"))
1208 {
1209returnnew Long(getId());
1210 }
1211if (name.equals("Name"))
1212 {
1213return getName();
1214 }
1215if (name.equals("Hidden"))
1216 {
1217returnnew Boolean(getHidden());
1218 }
1219if (name.equals("Classname"))
1220 {
1221return getClassname();
1222 }
1223if (name.equals("Type"))
1224 {
1225return getType();
1226 }
1227if (name.equals("Application"))
1228 {
1229returnnew Boolean(getApplication());
1230 }
1231if (name.equals("ParentRef"))
1232 {
1233returnnew Long(getParentRef());
1234 }
1235if (name.equals("URL"))
1236 {
1237return getURL();
1238 }
1239if (name.equals("Cachedonurl"))
1240 {
1241returnnew Boolean(getCachedonurl());
1242 }
1243if (name.equals("Role"))
1244 {
1245return getRole();
1246 }
1247if (name.equals("Title"))
1248 {
1249return getTitle();
1250 }
1251if (name.equals("Description"))
1252 {
1253return getDescription();
1254 }
1255if (name.equals("Image"))
1256 {
1257return getImage();
1258 }
1259if (name.equals("SecurityRef"))
1260 {
1261return getSecurityRef();
1262 }
1263returnnull;
1264 }
12651266/***1267 * Retrieves a field from the object by name passed in1268 * as a String. The String must be one of the static1269 * Strings defined in this Class' Peer.1270 */1271public Object getByPeerName(String name)
1272 {
1273if (name.equals(PortletDbEntryPeer.ID ))
1274 {
1275returnnew Long(getId());
1276 }
1277if (name.equals(PortletDbEntryPeer.NAME ))
1278 {
1279return getName();
1280 }
1281if (name.equals(PortletDbEntryPeer.HIDDEN ))
1282 {
1283returnnew Boolean(getHidden());
1284 }
1285if (name.equals(PortletDbEntryPeer.CLASSNAME ))
1286 {
1287return getClassname();
1288 }
1289if (name.equals(PortletDbEntryPeer.TYPE ))
1290 {
1291return getType();
1292 }
1293if (name.equals(PortletDbEntryPeer.APPLICATION ))
1294 {
1295returnnew Boolean(getApplication());
1296 }
1297if (name.equals(PortletDbEntryPeer.PARENT ))
1298 {
1299returnnew Long(getParentRef());
1300 }
1301if (name.equals(PortletDbEntryPeer.URL ))
1302 {
1303return getURL();
1304 }
1305if (name.equals(PortletDbEntryPeer.CACHEDONURL ))
1306 {
1307returnnew Boolean(getCachedonurl());
1308 }
1309if (name.equals(PortletDbEntryPeer.ROLE ))
1310 {
1311return getRole();
1312 }
1313if (name.equals(PortletDbEntryPeer.TITLE ))
1314 {
1315return getTitle();
1316 }
1317if (name.equals(PortletDbEntryPeer.DESCRIPTION ))
1318 {
1319return getDescription();
1320 }
1321if (name.equals(PortletDbEntryPeer.IMAGE ))
1322 {
1323return getImage();
1324 }
1325if (name.equals(PortletDbEntryPeer.SECURITY ))
1326 {
1327return getSecurityRef();
1328 }
1329returnnull;
1330 }
13311332/***1333 * Retrieves a field from the object by Position as specified1334 * in the xml schema. Zero-based.1335 */1336public Object getByPosition(int pos)
1337 {
1338if ( pos == 0 )
1339 {
1340returnnew Long(getId());
1341 }
1342if ( pos == 1 )
1343 {
1344return getName();
1345 }
1346if ( pos == 2 )
1347 {
1348returnnew Boolean(getHidden());
1349 }
1350if ( pos == 3 )
1351 {
1352return getClassname();
1353 }
1354if ( pos == 4 )
1355 {
1356return getType();
1357 }
1358if ( pos == 5 )
1359 {
1360returnnew Boolean(getApplication());
1361 }
1362if ( pos == 6 )
1363 {
1364returnnew Long(getParentRef());
1365 }
1366if ( pos == 7 )
1367 {
1368return getURL();
1369 }
1370if ( pos == 8 )
1371 {
1372returnnew Boolean(getCachedonurl());
1373 }
1374if ( pos == 9 )
1375 {
1376return getRole();
1377 }
1378if ( pos == 10 )
1379 {
1380return getTitle();
1381 }
1382if ( pos == 11 )
1383 {
1384return getDescription();
1385 }
1386if ( pos == 12 )
1387 {
1388return getImage();
1389 }
1390if ( pos == 13 )
1391 {
1392return getSecurityRef();
1393 }
1394returnnull;
1395 }
13961397/***1398 * Stores the object in the database. If the object is new,1399 * it inserts it; otherwise an update is performed.1400 */1401publicvoid save() throws Exception
1402 {
1403 save(PortletDbEntryPeer.getMapBuilder()
1404 .getDatabaseMap().getName());
1405 }
14061407/***1408 * Stores the object in the database. If the object is new,1409 * it inserts it; otherwise an update is performed.1410 * Note: this code is here because the method body is1411 * auto-generated conditionally and therefore needs to be1412 * in this file instead of in the super class, BaseObject.1413 */1414publicvoid save(String dbName) throws TorqueException
1415 {
1416 Connection con = null;
1417try1418 {
1419 con = Transaction.begin(dbName);
1420 save(con);
1421 Transaction.commit(con);
1422 }
1423catch(TorqueException e)
1424 {
1425 Transaction.safeRollback(con);
1426throw e;
1427 }
1428 }
14291430/*** flag to prevent endless save loop, if this object is referenced1431 by another object which falls in this transaction. */1432privateboolean alreadyInSave = false;
1433/***1434 * Stores the object in the database. If the object is new,1435 * it inserts it; otherwise an update is performed. This method1436 * is meant to be used as part of a transaction, otherwise use1437 * the save() method and the connection details will be handled1438 * internally1439 */1440publicvoid save(Connection con) throws TorqueException
1441 {
1442if (!alreadyInSave)
1443 {
1444 alreadyInSave = true;
1445144614471448// If this object has been modified, then save it to the database.1449if (isModified())
1450 {
1451if (isNew())
1452 {
1453 PortletDbEntryPeer.doInsert((PortletDbEntry)this, con);
1454 setNew(false);
1455 }
1456else1457 {
1458 PortletDbEntryPeer.doUpdate((PortletDbEntry)this, con);
1459 }
14601461if (isCacheOnSave())
1462 {
1463 PortletDbEntryManager.putInstance(this);
1464 }
1465 }
146614671468if (collPortletCategorys != null )
1469 {
1470for (int i = 0; i < collPortletCategorys.size(); i++)
1471 {
1472 ((PortletCategory)collPortletCategorys.get(i)).save(con);
1473 }
1474 }
14751476if (collPortletParameters != null )
1477 {
1478for (int i = 0; i < collPortletParameters.size(); i++)
1479 {
1480 ((PortletParameter)collPortletParameters.get(i)).save(con);
1481 }
1482 }
14831484if (collPortletMediatypes != null )
1485 {
1486for (int i = 0; i < collPortletMediatypes.size(); i++)
1487 {
1488 ((PortletMediatype)collPortletMediatypes.get(i)).save(con);
1489 }
1490 }
1491 alreadyInSave = false;
1492 }
1493 }
14941495/***1496 * Specify whether to cache the object after saving to the db.1497 * This method returns false1498 */1499protectedboolean isCacheOnSave()
1500 {
1501returntrue;
1502 }
150315041505/***1506 * Set the PrimaryKey using ObjectKey.1507 *1508 * @param ObjectKey id1509 */1510publicvoid setPrimaryKey(ObjectKey id)
1511 throws TorqueException {
1512 setId(((NumberKey)id).longValue());
1513 }
15141515/***1516 * Set the PrimaryKey using a String.1517 */1518publicvoid setPrimaryKey(String key) throws TorqueException
1519 {
1520 setId(Long.parseLong(key));
1521 }
152215231524/***1525 * returns an id that differentiates this object from others1526 * of its class.1527 */1528public ObjectKey getPrimaryKey()
1529 {
1530return SimpleKey.keyFor(getId());
1531 }
153215331534/***1535 * Makes a copy of this object.1536 * It creates a new object filling in the simple attributes.1537 * It then fills all the association collections.1538 */1539publicPortletDbEntry copy() throws TorqueException
1540 {
1541PortletDbEntry copyObj = newPortletDbEntry();
1542 copyObj.setId(id);
1543 copyObj.setName(name);
1544 copyObj.setHidden(hidden);
1545 copyObj.setClassname(classname);
1546 copyObj.setType(type);
1547 copyObj.setApplication(application);
1548 copyObj.setParentRef(parentRef);
1549 copyObj.setURL(uRL);
1550 copyObj.setCachedonurl(cachedonurl);
1551 copyObj.setRole(role);
1552 copyObj.setTitle(title);
1553 copyObj.setDescription(description);
1554 copyObj.setImage(image);
1555 copyObj.setSecurityRef(securityRef);
15561557 copyObj.setId(0);
1558155915601561 List v = getPortletCategorys();
1562for (int i = 0; i < v.size(); i++)
1563 {
1564PortletCategory obj = (PortletCategory) v.get(i);
1565 copyObj.addPortletCategory(obj.copy());
1566 }
156715681569 v = getPortletParameters();
1570for (int i = 0; i < v.size(); i++)
1571 {
1572PortletParameter obj = (PortletParameter) v.get(i);
1573 copyObj.addPortletParameter(obj.copy());
1574 }
157515761577 v = getPortletMediatypes();
1578for (int i = 0; i < v.size(); i++)
1579 {
1580PortletMediatype obj = (PortletMediatype) v.get(i);
1581 copyObj.addPortletMediatype(obj.copy());
1582 }
1583return copyObj;
1584 }
15851586/***1587 * returns a peer instance associated with this om. Since Peer classes1588 * are not to have any instance attributes, this method returns the1589 * same instance for all member of this class. The method could therefore1590 * be static, but this would prevent one from overriding the behavior.1591 */1592publicPortletDbEntryPeer getPeer()
1593 {
1594return peer;
1595 }
1596 }