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