001
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.IndexableActionableDynamicQuery;
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.PersistedModel;
037 import com.liferay.portal.model.RecentLayoutBranch;
038 import com.liferay.portal.service.BaseLocalServiceImpl;
039 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
040 import com.liferay.portal.service.RecentLayoutBranchLocalService;
041 import com.liferay.portal.service.persistence.LayoutBranchPersistence;
042 import com.liferay.portal.service.persistence.RecentLayoutBranchPersistence;
043 import com.liferay.portal.util.PortalUtil;
044
045 import java.io.Serializable;
046
047 import java.util.List;
048
049 import javax.sql.DataSource;
050
051
063 @ProviderType
064 public abstract class RecentLayoutBranchLocalServiceBaseImpl
065 extends BaseLocalServiceImpl implements RecentLayoutBranchLocalService,
066 IdentifiableOSGiService {
067
072
073
079 @Indexable(type = IndexableType.REINDEX)
080 @Override
081 public RecentLayoutBranch addRecentLayoutBranch(
082 RecentLayoutBranch recentLayoutBranch) {
083 recentLayoutBranch.setNew(true);
084
085 return recentLayoutBranchPersistence.update(recentLayoutBranch);
086 }
087
088
094 @Override
095 public RecentLayoutBranch createRecentLayoutBranch(
096 long recentLayoutBranchId) {
097 return recentLayoutBranchPersistence.create(recentLayoutBranchId);
098 }
099
100
107 @Indexable(type = IndexableType.DELETE)
108 @Override
109 public RecentLayoutBranch deleteRecentLayoutBranch(
110 long recentLayoutBranchId) throws PortalException {
111 return recentLayoutBranchPersistence.remove(recentLayoutBranchId);
112 }
113
114
120 @Indexable(type = IndexableType.DELETE)
121 @Override
122 public RecentLayoutBranch deleteRecentLayoutBranch(
123 RecentLayoutBranch recentLayoutBranch) {
124 return recentLayoutBranchPersistence.remove(recentLayoutBranch);
125 }
126
127 @Override
128 public DynamicQuery dynamicQuery() {
129 Class<?> clazz = getClass();
130
131 return DynamicQueryFactoryUtil.forClass(RecentLayoutBranch.class,
132 clazz.getClassLoader());
133 }
134
135
141 @Override
142 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
143 return recentLayoutBranchPersistence.findWithDynamicQuery(dynamicQuery);
144 }
145
146
158 @Override
159 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
160 int end) {
161 return recentLayoutBranchPersistence.findWithDynamicQuery(dynamicQuery,
162 start, end);
163 }
164
165
178 @Override
179 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
180 int end, OrderByComparator<T> orderByComparator) {
181 return recentLayoutBranchPersistence.findWithDynamicQuery(dynamicQuery,
182 start, end, orderByComparator);
183 }
184
185
191 @Override
192 public long dynamicQueryCount(DynamicQuery dynamicQuery) {
193 return recentLayoutBranchPersistence.countWithDynamicQuery(dynamicQuery);
194 }
195
196
203 @Override
204 public long dynamicQueryCount(DynamicQuery dynamicQuery,
205 Projection projection) {
206 return recentLayoutBranchPersistence.countWithDynamicQuery(dynamicQuery,
207 projection);
208 }
209
210 @Override
211 public RecentLayoutBranch fetchRecentLayoutBranch(long recentLayoutBranchId) {
212 return recentLayoutBranchPersistence.fetchByPrimaryKey(recentLayoutBranchId);
213 }
214
215
222 @Override
223 public RecentLayoutBranch getRecentLayoutBranch(long recentLayoutBranchId)
224 throws PortalException {
225 return recentLayoutBranchPersistence.findByPrimaryKey(recentLayoutBranchId);
226 }
227
228 @Override
229 public ActionableDynamicQuery getActionableDynamicQuery() {
230 ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
231
232 actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.RecentLayoutBranchLocalServiceUtil.getService());
233 actionableDynamicQuery.setClassLoader(getClassLoader());
234 actionableDynamicQuery.setModelClass(RecentLayoutBranch.class);
235
236 actionableDynamicQuery.setPrimaryKeyPropertyName("recentLayoutBranchId");
237
238 return actionableDynamicQuery;
239 }
240
241 @Override
242 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
243 IndexableActionableDynamicQuery indexableActionableDynamicQuery = new IndexableActionableDynamicQuery();
244
245 indexableActionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.RecentLayoutBranchLocalServiceUtil.getService());
246 indexableActionableDynamicQuery.setClassLoader(getClassLoader());
247 indexableActionableDynamicQuery.setModelClass(RecentLayoutBranch.class);
248
249 indexableActionableDynamicQuery.setPrimaryKeyPropertyName(
250 "recentLayoutBranchId");
251
252 return indexableActionableDynamicQuery;
253 }
254
255 protected void initActionableDynamicQuery(
256 ActionableDynamicQuery actionableDynamicQuery) {
257 actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.RecentLayoutBranchLocalServiceUtil.getService());
258 actionableDynamicQuery.setClassLoader(getClassLoader());
259 actionableDynamicQuery.setModelClass(RecentLayoutBranch.class);
260
261 actionableDynamicQuery.setPrimaryKeyPropertyName("recentLayoutBranchId");
262 }
263
264
267 @Override
268 public PersistedModel deletePersistedModel(PersistedModel persistedModel)
269 throws PortalException {
270 return recentLayoutBranchLocalService.deleteRecentLayoutBranch((RecentLayoutBranch)persistedModel);
271 }
272
273 @Override
274 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
275 throws PortalException {
276 return recentLayoutBranchPersistence.findByPrimaryKey(primaryKeyObj);
277 }
278
279
290 @Override
291 public List<RecentLayoutBranch> getRecentLayoutBranchs(int start, int end) {
292 return recentLayoutBranchPersistence.findAll(start, end);
293 }
294
295
300 @Override
301 public int getRecentLayoutBranchsCount() {
302 return recentLayoutBranchPersistence.countAll();
303 }
304
305
311 @Indexable(type = IndexableType.REINDEX)
312 @Override
313 public RecentLayoutBranch updateRecentLayoutBranch(
314 RecentLayoutBranch recentLayoutBranch) {
315 return recentLayoutBranchPersistence.update(recentLayoutBranch);
316 }
317
318
323 public RecentLayoutBranchLocalService getRecentLayoutBranchLocalService() {
324 return recentLayoutBranchLocalService;
325 }
326
327
332 public void setRecentLayoutBranchLocalService(
333 RecentLayoutBranchLocalService recentLayoutBranchLocalService) {
334 this.recentLayoutBranchLocalService = recentLayoutBranchLocalService;
335 }
336
337
342 public RecentLayoutBranchPersistence getRecentLayoutBranchPersistence() {
343 return recentLayoutBranchPersistence;
344 }
345
346
351 public void setRecentLayoutBranchPersistence(
352 RecentLayoutBranchPersistence recentLayoutBranchPersistence) {
353 this.recentLayoutBranchPersistence = recentLayoutBranchPersistence;
354 }
355
356
361 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
362 return counterLocalService;
363 }
364
365
370 public void setCounterLocalService(
371 com.liferay.counter.service.CounterLocalService counterLocalService) {
372 this.counterLocalService = counterLocalService;
373 }
374
375
380 public com.liferay.portal.service.LayoutBranchLocalService getLayoutBranchLocalService() {
381 return layoutBranchLocalService;
382 }
383
384
389 public void setLayoutBranchLocalService(
390 com.liferay.portal.service.LayoutBranchLocalService layoutBranchLocalService) {
391 this.layoutBranchLocalService = layoutBranchLocalService;
392 }
393
394
399 public LayoutBranchPersistence getLayoutBranchPersistence() {
400 return layoutBranchPersistence;
401 }
402
403
408 public void setLayoutBranchPersistence(
409 LayoutBranchPersistence layoutBranchPersistence) {
410 this.layoutBranchPersistence = layoutBranchPersistence;
411 }
412
413 public void afterPropertiesSet() {
414 persistedModelLocalServiceRegistry.register("com.liferay.portal.model.RecentLayoutBranch",
415 recentLayoutBranchLocalService);
416 }
417
418 public void destroy() {
419 persistedModelLocalServiceRegistry.unregister(
420 "com.liferay.portal.model.RecentLayoutBranch");
421 }
422
423
428 @Override
429 public String getOSGiServiceIdentifier() {
430 return RecentLayoutBranchLocalService.class.getName();
431 }
432
433 protected Class<?> getModelClass() {
434 return RecentLayoutBranch.class;
435 }
436
437 protected String getModelClassName() {
438 return RecentLayoutBranch.class.getName();
439 }
440
441
446 protected void runSQL(String sql) {
447 try {
448 DataSource dataSource = recentLayoutBranchPersistence.getDataSource();
449
450 DB db = DBManagerUtil.getDB();
451
452 sql = db.buildSQL(sql);
453 sql = PortalUtil.transformSQL(sql);
454
455 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
456 sql, new int[0]);
457
458 sqlUpdate.update();
459 }
460 catch (Exception e) {
461 throw new SystemException(e);
462 }
463 }
464
465 @BeanReference(type = com.liferay.portal.service.RecentLayoutBranchLocalService.class)
466 protected RecentLayoutBranchLocalService recentLayoutBranchLocalService;
467 @BeanReference(type = RecentLayoutBranchPersistence.class)
468 protected RecentLayoutBranchPersistence recentLayoutBranchPersistence;
469 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
470 protected com.liferay.counter.service.CounterLocalService counterLocalService;
471 @BeanReference(type = com.liferay.portal.service.LayoutBranchLocalService.class)
472 protected com.liferay.portal.service.LayoutBranchLocalService layoutBranchLocalService;
473 @BeanReference(type = LayoutBranchPersistence.class)
474 protected LayoutBranchPersistence layoutBranchPersistence;
475 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
476 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
477 }