001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.base;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.BeanReference;
020    import com.liferay.portal.kernel.bean.IdentifiableBean;
021    import com.liferay.portal.kernel.dao.db.DB;
022    import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
023    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
024    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
025    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
028    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
029    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
030    import com.liferay.portal.kernel.dao.orm.Projection;
031    import com.liferay.portal.kernel.exception.PortalException;
032    import com.liferay.portal.kernel.exception.SystemException;
033    import com.liferay.portal.kernel.lar.ExportImportHelperUtil;
034    import com.liferay.portal.kernel.lar.ManifestSummary;
035    import com.liferay.portal.kernel.lar.PortletDataContext;
036    import com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil;
037    import com.liferay.portal.kernel.lar.StagedModelType;
038    import com.liferay.portal.kernel.search.Indexable;
039    import com.liferay.portal.kernel.search.IndexableType;
040    import com.liferay.portal.kernel.util.OrderByComparator;
041    import com.liferay.portal.model.LayoutFriendlyURL;
042    import com.liferay.portal.model.PersistedModel;
043    import com.liferay.portal.service.BaseLocalServiceImpl;
044    import com.liferay.portal.service.LayoutFriendlyURLLocalService;
045    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
046    import com.liferay.portal.service.persistence.LayoutFriendlyURLPersistence;
047    import com.liferay.portal.service.persistence.UserFinder;
048    import com.liferay.portal.service.persistence.UserPersistence;
049    import com.liferay.portal.util.PortalUtil;
050    
051    import java.io.Serializable;
052    
053    import java.util.List;
054    
055    import javax.sql.DataSource;
056    
057    /**
058     * Provides the base implementation for the layout friendly u r l local service.
059     *
060     * <p>
061     * This implementation exists only as a container for the default service methods generated by ServiceBuilder. All custom service methods should be put in {@link com.liferay.portal.service.impl.LayoutFriendlyURLLocalServiceImpl}.
062     * </p>
063     *
064     * @author Brian Wing Shun Chan
065     * @see com.liferay.portal.service.impl.LayoutFriendlyURLLocalServiceImpl
066     * @see com.liferay.portal.service.LayoutFriendlyURLLocalServiceUtil
067     * @generated
068     */
069    @ProviderType
070    public abstract class LayoutFriendlyURLLocalServiceBaseImpl
071            extends BaseLocalServiceImpl implements LayoutFriendlyURLLocalService,
072                    IdentifiableBean {
073            /*
074             * NOTE FOR DEVELOPERS:
075             *
076             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.LayoutFriendlyURLLocalServiceUtil} to access the layout friendly u r l local service.
077             */
078    
079            /**
080             * Adds the layout friendly u r l to the database. Also notifies the appropriate model listeners.
081             *
082             * @param layoutFriendlyURL the layout friendly u r l
083             * @return the layout friendly u r l that was added
084             */
085            @Indexable(type = IndexableType.REINDEX)
086            @Override
087            public LayoutFriendlyURL addLayoutFriendlyURL(
088                    LayoutFriendlyURL layoutFriendlyURL) {
089                    layoutFriendlyURL.setNew(true);
090    
091                    return layoutFriendlyURLPersistence.update(layoutFriendlyURL);
092            }
093    
094            /**
095             * Creates a new layout friendly u r l with the primary key. Does not add the layout friendly u r l to the database.
096             *
097             * @param layoutFriendlyURLId the primary key for the new layout friendly u r l
098             * @return the new layout friendly u r l
099             */
100            @Override
101            public LayoutFriendlyURL createLayoutFriendlyURL(long layoutFriendlyURLId) {
102                    return layoutFriendlyURLPersistence.create(layoutFriendlyURLId);
103            }
104    
105            /**
106             * Deletes the layout friendly u r l with the primary key from the database. Also notifies the appropriate model listeners.
107             *
108             * @param layoutFriendlyURLId the primary key of the layout friendly u r l
109             * @return the layout friendly u r l that was removed
110             * @throws PortalException if a layout friendly u r l with the primary key could not be found
111             */
112            @Indexable(type = IndexableType.DELETE)
113            @Override
114            public LayoutFriendlyURL deleteLayoutFriendlyURL(long layoutFriendlyURLId)
115                    throws PortalException {
116                    return layoutFriendlyURLPersistence.remove(layoutFriendlyURLId);
117            }
118    
119            /**
120             * Deletes the layout friendly u r l from the database. Also notifies the appropriate model listeners.
121             *
122             * @param layoutFriendlyURL the layout friendly u r l
123             * @return the layout friendly u r l that was removed
124             */
125            @Indexable(type = IndexableType.DELETE)
126            @Override
127            public LayoutFriendlyURL deleteLayoutFriendlyURL(
128                    LayoutFriendlyURL layoutFriendlyURL) {
129                    return layoutFriendlyURLPersistence.remove(layoutFriendlyURL);
130            }
131    
132            @Override
133            public DynamicQuery dynamicQuery() {
134                    Class<?> clazz = getClass();
135    
136                    return DynamicQueryFactoryUtil.forClass(LayoutFriendlyURL.class,
137                            clazz.getClassLoader());
138            }
139    
140            /**
141             * Performs a dynamic query on the database and returns the matching rows.
142             *
143             * @param dynamicQuery the dynamic query
144             * @return the matching rows
145             */
146            @Override
147            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
148                    return layoutFriendlyURLPersistence.findWithDynamicQuery(dynamicQuery);
149            }
150    
151            /**
152             * Performs a dynamic query on the database and returns a range of the matching rows.
153             *
154             * <p>
155             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.LayoutFriendlyURLModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
156             * </p>
157             *
158             * @param dynamicQuery the dynamic query
159             * @param start the lower bound of the range of model instances
160             * @param end the upper bound of the range of model instances (not inclusive)
161             * @return the range of matching rows
162             */
163            @Override
164            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
165                    int end) {
166                    return layoutFriendlyURLPersistence.findWithDynamicQuery(dynamicQuery,
167                            start, end);
168            }
169    
170            /**
171             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
172             *
173             * <p>
174             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.LayoutFriendlyURLModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
175             * </p>
176             *
177             * @param dynamicQuery the dynamic query
178             * @param start the lower bound of the range of model instances
179             * @param end the upper bound of the range of model instances (not inclusive)
180             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
181             * @return the ordered range of matching rows
182             */
183            @Override
184            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
185                    int end, OrderByComparator<T> orderByComparator) {
186                    return layoutFriendlyURLPersistence.findWithDynamicQuery(dynamicQuery,
187                            start, end, orderByComparator);
188            }
189    
190            /**
191             * Returns the number of rows matching the dynamic query.
192             *
193             * @param dynamicQuery the dynamic query
194             * @return the number of rows matching the dynamic query
195             */
196            @Override
197            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
198                    return layoutFriendlyURLPersistence.countWithDynamicQuery(dynamicQuery);
199            }
200    
201            /**
202             * Returns the number of rows matching the dynamic query.
203             *
204             * @param dynamicQuery the dynamic query
205             * @param projection the projection to apply to the query
206             * @return the number of rows matching the dynamic query
207             */
208            @Override
209            public long dynamicQueryCount(DynamicQuery dynamicQuery,
210                    Projection projection) {
211                    return layoutFriendlyURLPersistence.countWithDynamicQuery(dynamicQuery,
212                            projection);
213            }
214    
215            @Override
216            public LayoutFriendlyURL fetchLayoutFriendlyURL(long layoutFriendlyURLId) {
217                    return layoutFriendlyURLPersistence.fetchByPrimaryKey(layoutFriendlyURLId);
218            }
219    
220            /**
221             * Returns the layout friendly u r l matching the UUID and group.
222             *
223             * @param uuid the layout friendly u r l's UUID
224             * @param groupId the primary key of the group
225             * @return the matching layout friendly u r l, or <code>null</code> if a matching layout friendly u r l could not be found
226             */
227            @Override
228            public LayoutFriendlyURL fetchLayoutFriendlyURLByUuidAndGroupId(
229                    String uuid, long groupId) {
230                    return layoutFriendlyURLPersistence.fetchByUUID_G(uuid, groupId);
231            }
232    
233            /**
234             * Returns the layout friendly u r l with the primary key.
235             *
236             * @param layoutFriendlyURLId the primary key of the layout friendly u r l
237             * @return the layout friendly u r l
238             * @throws PortalException if a layout friendly u r l with the primary key could not be found
239             */
240            @Override
241            public LayoutFriendlyURL getLayoutFriendlyURL(long layoutFriendlyURLId)
242                    throws PortalException {
243                    return layoutFriendlyURLPersistence.findByPrimaryKey(layoutFriendlyURLId);
244            }
245    
246            @Override
247            public ActionableDynamicQuery getActionableDynamicQuery() {
248                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
249    
250                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.LayoutFriendlyURLLocalServiceUtil.getService());
251                    actionableDynamicQuery.setClass(LayoutFriendlyURL.class);
252                    actionableDynamicQuery.setClassLoader(getClassLoader());
253    
254                    actionableDynamicQuery.setPrimaryKeyPropertyName("layoutFriendlyURLId");
255    
256                    return actionableDynamicQuery;
257            }
258    
259            protected void initActionableDynamicQuery(
260                    ActionableDynamicQuery actionableDynamicQuery) {
261                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.LayoutFriendlyURLLocalServiceUtil.getService());
262                    actionableDynamicQuery.setClass(LayoutFriendlyURL.class);
263                    actionableDynamicQuery.setClassLoader(getClassLoader());
264    
265                    actionableDynamicQuery.setPrimaryKeyPropertyName("layoutFriendlyURLId");
266            }
267    
268            @Override
269            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
270                    final PortletDataContext portletDataContext) {
271                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
272                                    @Override
273                                    public long performCount() throws PortalException {
274                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
275    
276                                            StagedModelType stagedModelType = getStagedModelType();
277    
278                                            long modelAdditionCount = super.performCount();
279    
280                                            manifestSummary.addModelAdditionCount(stagedModelType.toString(),
281                                                    modelAdditionCount);
282    
283                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
284                                                            stagedModelType);
285    
286                                            manifestSummary.addModelDeletionCount(stagedModelType.toString(),
287                                                    modelDeletionCount);
288    
289                                            return modelAdditionCount;
290                                    }
291                            };
292    
293                    initActionableDynamicQuery(exportActionableDynamicQuery);
294    
295                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
296                                    @Override
297                                    public void addCriteria(DynamicQuery dynamicQuery) {
298                                            portletDataContext.addDateRangeCriteria(dynamicQuery,
299                                                    "modifiedDate");
300                                    }
301                            });
302    
303                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
304    
305                    exportActionableDynamicQuery.setGroupId(portletDataContext.getScopeGroupId());
306    
307                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod() {
308                                    @Override
309                                    public void performAction(Object object)
310                                            throws PortalException {
311                                            LayoutFriendlyURL stagedModel = (LayoutFriendlyURL)object;
312    
313                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
314                                                    stagedModel);
315                                    }
316                            });
317                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
318                                    PortalUtil.getClassNameId(LayoutFriendlyURL.class.getName())));
319    
320                    return exportActionableDynamicQuery;
321            }
322    
323            /**
324             * @throws PortalException
325             */
326            @Override
327            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
328                    throws PortalException {
329                    return layoutFriendlyURLLocalService.deleteLayoutFriendlyURL((LayoutFriendlyURL)persistedModel);
330            }
331    
332            @Override
333            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
334                    throws PortalException {
335                    return layoutFriendlyURLPersistence.findByPrimaryKey(primaryKeyObj);
336            }
337    
338            /**
339             * Returns all the layout friendly u r ls matching the UUID and company.
340             *
341             * @param uuid the UUID of the layout friendly u r ls
342             * @param companyId the primary key of the company
343             * @return the matching layout friendly u r ls, or an empty list if no matches were found
344             */
345            @Override
346            public List<LayoutFriendlyURL> getLayoutFriendlyURLsByUuidAndCompanyId(
347                    String uuid, long companyId) {
348                    return layoutFriendlyURLPersistence.findByUuid_C(uuid, companyId);
349            }
350    
351            /**
352             * Returns a range of layout friendly u r ls matching the UUID and company.
353             *
354             * @param uuid the UUID of the layout friendly u r ls
355             * @param companyId the primary key of the company
356             * @param start the lower bound of the range of layout friendly u r ls
357             * @param end the upper bound of the range of layout friendly u r ls (not inclusive)
358             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
359             * @return the range of matching layout friendly u r ls, or an empty list if no matches were found
360             */
361            @Override
362            public List<LayoutFriendlyURL> getLayoutFriendlyURLsByUuidAndCompanyId(
363                    String uuid, long companyId, int start, int end,
364                    OrderByComparator<LayoutFriendlyURL> orderByComparator) {
365                    return layoutFriendlyURLPersistence.findByUuid_C(uuid, companyId,
366                            start, end, orderByComparator);
367            }
368    
369            /**
370             * Returns the layout friendly u r l matching the UUID and group.
371             *
372             * @param uuid the layout friendly u r l's UUID
373             * @param groupId the primary key of the group
374             * @return the matching layout friendly u r l
375             * @throws PortalException if a matching layout friendly u r l could not be found
376             */
377            @Override
378            public LayoutFriendlyURL getLayoutFriendlyURLByUuidAndGroupId(String uuid,
379                    long groupId) throws PortalException {
380                    return layoutFriendlyURLPersistence.findByUUID_G(uuid, groupId);
381            }
382    
383            /**
384             * Returns a range of all the layout friendly u r ls.
385             *
386             * <p>
387             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.LayoutFriendlyURLModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
388             * </p>
389             *
390             * @param start the lower bound of the range of layout friendly u r ls
391             * @param end the upper bound of the range of layout friendly u r ls (not inclusive)
392             * @return the range of layout friendly u r ls
393             */
394            @Override
395            public List<LayoutFriendlyURL> getLayoutFriendlyURLs(int start, int end) {
396                    return layoutFriendlyURLPersistence.findAll(start, end);
397            }
398    
399            /**
400             * Returns the number of layout friendly u r ls.
401             *
402             * @return the number of layout friendly u r ls
403             */
404            @Override
405            public int getLayoutFriendlyURLsCount() {
406                    return layoutFriendlyURLPersistence.countAll();
407            }
408    
409            /**
410             * Updates the layout friendly u r l in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
411             *
412             * @param layoutFriendlyURL the layout friendly u r l
413             * @return the layout friendly u r l that was updated
414             */
415            @Indexable(type = IndexableType.REINDEX)
416            @Override
417            public LayoutFriendlyURL updateLayoutFriendlyURL(
418                    LayoutFriendlyURL layoutFriendlyURL) {
419                    return layoutFriendlyURLPersistence.update(layoutFriendlyURL);
420            }
421    
422            /**
423             * Returns the layout friendly u r l local service.
424             *
425             * @return the layout friendly u r l local service
426             */
427            public com.liferay.portal.service.LayoutFriendlyURLLocalService getLayoutFriendlyURLLocalService() {
428                    return layoutFriendlyURLLocalService;
429            }
430    
431            /**
432             * Sets the layout friendly u r l local service.
433             *
434             * @param layoutFriendlyURLLocalService the layout friendly u r l local service
435             */
436            public void setLayoutFriendlyURLLocalService(
437                    com.liferay.portal.service.LayoutFriendlyURLLocalService layoutFriendlyURLLocalService) {
438                    this.layoutFriendlyURLLocalService = layoutFriendlyURLLocalService;
439            }
440    
441            /**
442             * Returns the layout friendly u r l persistence.
443             *
444             * @return the layout friendly u r l persistence
445             */
446            public LayoutFriendlyURLPersistence getLayoutFriendlyURLPersistence() {
447                    return layoutFriendlyURLPersistence;
448            }
449    
450            /**
451             * Sets the layout friendly u r l persistence.
452             *
453             * @param layoutFriendlyURLPersistence the layout friendly u r l persistence
454             */
455            public void setLayoutFriendlyURLPersistence(
456                    LayoutFriendlyURLPersistence layoutFriendlyURLPersistence) {
457                    this.layoutFriendlyURLPersistence = layoutFriendlyURLPersistence;
458            }
459    
460            /**
461             * Returns the counter local service.
462             *
463             * @return the counter local service
464             */
465            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
466                    return counterLocalService;
467            }
468    
469            /**
470             * Sets the counter local service.
471             *
472             * @param counterLocalService the counter local service
473             */
474            public void setCounterLocalService(
475                    com.liferay.counter.service.CounterLocalService counterLocalService) {
476                    this.counterLocalService = counterLocalService;
477            }
478    
479            /**
480             * Returns the user local service.
481             *
482             * @return the user local service
483             */
484            public com.liferay.portal.service.UserLocalService getUserLocalService() {
485                    return userLocalService;
486            }
487    
488            /**
489             * Sets the user local service.
490             *
491             * @param userLocalService the user local service
492             */
493            public void setUserLocalService(
494                    com.liferay.portal.service.UserLocalService userLocalService) {
495                    this.userLocalService = userLocalService;
496            }
497    
498            /**
499             * Returns the user remote service.
500             *
501             * @return the user remote service
502             */
503            public com.liferay.portal.service.UserService getUserService() {
504                    return userService;
505            }
506    
507            /**
508             * Sets the user remote service.
509             *
510             * @param userService the user remote service
511             */
512            public void setUserService(
513                    com.liferay.portal.service.UserService userService) {
514                    this.userService = userService;
515            }
516    
517            /**
518             * Returns the user persistence.
519             *
520             * @return the user persistence
521             */
522            public UserPersistence getUserPersistence() {
523                    return userPersistence;
524            }
525    
526            /**
527             * Sets the user persistence.
528             *
529             * @param userPersistence the user persistence
530             */
531            public void setUserPersistence(UserPersistence userPersistence) {
532                    this.userPersistence = userPersistence;
533            }
534    
535            /**
536             * Returns the user finder.
537             *
538             * @return the user finder
539             */
540            public UserFinder getUserFinder() {
541                    return userFinder;
542            }
543    
544            /**
545             * Sets the user finder.
546             *
547             * @param userFinder the user finder
548             */
549            public void setUserFinder(UserFinder userFinder) {
550                    this.userFinder = userFinder;
551            }
552    
553            public void afterPropertiesSet() {
554                    persistedModelLocalServiceRegistry.register("com.liferay.portal.model.LayoutFriendlyURL",
555                            layoutFriendlyURLLocalService);
556            }
557    
558            public void destroy() {
559                    persistedModelLocalServiceRegistry.unregister(
560                            "com.liferay.portal.model.LayoutFriendlyURL");
561            }
562    
563            /**
564             * Returns the Spring bean ID for this bean.
565             *
566             * @return the Spring bean ID for this bean
567             */
568            @Override
569            public String getBeanIdentifier() {
570                    return _beanIdentifier;
571            }
572    
573            /**
574             * Sets the Spring bean ID for this bean.
575             *
576             * @param beanIdentifier the Spring bean ID for this bean
577             */
578            @Override
579            public void setBeanIdentifier(String beanIdentifier) {
580                    _beanIdentifier = beanIdentifier;
581            }
582    
583            protected Class<?> getModelClass() {
584                    return LayoutFriendlyURL.class;
585            }
586    
587            protected String getModelClassName() {
588                    return LayoutFriendlyURL.class.getName();
589            }
590    
591            /**
592             * Performs a SQL query.
593             *
594             * @param sql the sql query
595             */
596            protected void runSQL(String sql) {
597                    try {
598                            DataSource dataSource = layoutFriendlyURLPersistence.getDataSource();
599    
600                            DB db = DBFactoryUtil.getDB();
601    
602                            sql = db.buildSQL(sql);
603                            sql = PortalUtil.transformSQL(sql);
604    
605                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
606                                            sql, new int[0]);
607    
608                            sqlUpdate.update();
609                    }
610                    catch (Exception e) {
611                            throw new SystemException(e);
612                    }
613            }
614    
615            @BeanReference(type = com.liferay.portal.service.LayoutFriendlyURLLocalService.class)
616            protected com.liferay.portal.service.LayoutFriendlyURLLocalService layoutFriendlyURLLocalService;
617            @BeanReference(type = LayoutFriendlyURLPersistence.class)
618            protected LayoutFriendlyURLPersistence layoutFriendlyURLPersistence;
619            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
620            protected com.liferay.counter.service.CounterLocalService counterLocalService;
621            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
622            protected com.liferay.portal.service.UserLocalService userLocalService;
623            @BeanReference(type = com.liferay.portal.service.UserService.class)
624            protected com.liferay.portal.service.UserService userService;
625            @BeanReference(type = UserPersistence.class)
626            protected UserPersistence userPersistence;
627            @BeanReference(type = UserFinder.class)
628            protected UserFinder userFinder;
629            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
630            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
631            private String _beanIdentifier;
632    }