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