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.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.Projection;
030 import com.liferay.portal.kernel.exception.PortalException;
031 import com.liferay.portal.kernel.exception.SystemException;
032 import com.liferay.portal.kernel.search.Indexable;
033 import com.liferay.portal.kernel.search.IndexableType;
034 import com.liferay.portal.kernel.util.OrderByComparator;
035 import com.liferay.portal.model.PersistedModel;
036 import com.liferay.portal.model.WebDAVProps;
037 import com.liferay.portal.service.BaseLocalServiceImpl;
038 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
039 import com.liferay.portal.service.WebDAVPropsLocalService;
040 import com.liferay.portal.service.persistence.ClassNamePersistence;
041 import com.liferay.portal.service.persistence.WebDAVPropsPersistence;
042 import com.liferay.portal.util.PortalUtil;
043
044 import java.io.Serializable;
045
046 import java.util.List;
047
048 import javax.sql.DataSource;
049
050
062 @ProviderType
063 public abstract class WebDAVPropsLocalServiceBaseImpl
064 extends BaseLocalServiceImpl implements WebDAVPropsLocalService,
065 IdentifiableBean {
066
071
072
078 @Indexable(type = IndexableType.REINDEX)
079 @Override
080 public WebDAVProps addWebDAVProps(WebDAVProps webDAVProps) {
081 webDAVProps.setNew(true);
082
083 return webDAVPropsPersistence.update(webDAVProps);
084 }
085
086
092 @Override
093 public WebDAVProps createWebDAVProps(long webDavPropsId) {
094 return webDAVPropsPersistence.create(webDavPropsId);
095 }
096
097
104 @Indexable(type = IndexableType.DELETE)
105 @Override
106 public WebDAVProps deleteWebDAVProps(long webDavPropsId)
107 throws PortalException {
108 return webDAVPropsPersistence.remove(webDavPropsId);
109 }
110
111
117 @Indexable(type = IndexableType.DELETE)
118 @Override
119 public WebDAVProps deleteWebDAVProps(WebDAVProps webDAVProps) {
120 return webDAVPropsPersistence.remove(webDAVProps);
121 }
122
123 @Override
124 public DynamicQuery dynamicQuery() {
125 Class<?> clazz = getClass();
126
127 return DynamicQueryFactoryUtil.forClass(WebDAVProps.class,
128 clazz.getClassLoader());
129 }
130
131
137 @Override
138 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
139 return webDAVPropsPersistence.findWithDynamicQuery(dynamicQuery);
140 }
141
142
154 @Override
155 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
156 int end) {
157 return webDAVPropsPersistence.findWithDynamicQuery(dynamicQuery, start,
158 end);
159 }
160
161
174 @Override
175 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
176 int end, OrderByComparator<T> orderByComparator) {
177 return webDAVPropsPersistence.findWithDynamicQuery(dynamicQuery, start,
178 end, orderByComparator);
179 }
180
181
187 @Override
188 public long dynamicQueryCount(DynamicQuery dynamicQuery) {
189 return webDAVPropsPersistence.countWithDynamicQuery(dynamicQuery);
190 }
191
192
199 @Override
200 public long dynamicQueryCount(DynamicQuery dynamicQuery,
201 Projection projection) {
202 return webDAVPropsPersistence.countWithDynamicQuery(dynamicQuery,
203 projection);
204 }
205
206 @Override
207 public WebDAVProps fetchWebDAVProps(long webDavPropsId) {
208 return webDAVPropsPersistence.fetchByPrimaryKey(webDavPropsId);
209 }
210
211
218 @Override
219 public WebDAVProps getWebDAVProps(long webDavPropsId)
220 throws PortalException {
221 return webDAVPropsPersistence.findByPrimaryKey(webDavPropsId);
222 }
223
224 @Override
225 public ActionableDynamicQuery getActionableDynamicQuery() {
226 ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
227
228 actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.WebDAVPropsLocalServiceUtil.getService());
229 actionableDynamicQuery.setClass(WebDAVProps.class);
230 actionableDynamicQuery.setClassLoader(getClassLoader());
231
232 actionableDynamicQuery.setPrimaryKeyPropertyName("webDavPropsId");
233
234 return actionableDynamicQuery;
235 }
236
237 protected void initActionableDynamicQuery(
238 ActionableDynamicQuery actionableDynamicQuery) {
239 actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.WebDAVPropsLocalServiceUtil.getService());
240 actionableDynamicQuery.setClass(WebDAVProps.class);
241 actionableDynamicQuery.setClassLoader(getClassLoader());
242
243 actionableDynamicQuery.setPrimaryKeyPropertyName("webDavPropsId");
244 }
245
246
249 @Override
250 public PersistedModel deletePersistedModel(PersistedModel persistedModel)
251 throws PortalException {
252 return webDAVPropsLocalService.deleteWebDAVProps((WebDAVProps)persistedModel);
253 }
254
255 @Override
256 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
257 throws PortalException {
258 return webDAVPropsPersistence.findByPrimaryKey(primaryKeyObj);
259 }
260
261
272 @Override
273 public List<WebDAVProps> getWebDAVPropses(int start, int end) {
274 return webDAVPropsPersistence.findAll(start, end);
275 }
276
277
282 @Override
283 public int getWebDAVPropsesCount() {
284 return webDAVPropsPersistence.countAll();
285 }
286
287
293 @Indexable(type = IndexableType.REINDEX)
294 @Override
295 public WebDAVProps updateWebDAVProps(WebDAVProps webDAVProps) {
296 return webDAVPropsPersistence.update(webDAVProps);
297 }
298
299
304 public com.liferay.portal.service.WebDAVPropsLocalService getWebDAVPropsLocalService() {
305 return webDAVPropsLocalService;
306 }
307
308
313 public void setWebDAVPropsLocalService(
314 com.liferay.portal.service.WebDAVPropsLocalService webDAVPropsLocalService) {
315 this.webDAVPropsLocalService = webDAVPropsLocalService;
316 }
317
318
323 public WebDAVPropsPersistence getWebDAVPropsPersistence() {
324 return webDAVPropsPersistence;
325 }
326
327
332 public void setWebDAVPropsPersistence(
333 WebDAVPropsPersistence webDAVPropsPersistence) {
334 this.webDAVPropsPersistence = webDAVPropsPersistence;
335 }
336
337
342 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
343 return counterLocalService;
344 }
345
346
351 public void setCounterLocalService(
352 com.liferay.counter.service.CounterLocalService counterLocalService) {
353 this.counterLocalService = counterLocalService;
354 }
355
356
361 public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
362 return classNameLocalService;
363 }
364
365
370 public void setClassNameLocalService(
371 com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
372 this.classNameLocalService = classNameLocalService;
373 }
374
375
380 public com.liferay.portal.service.ClassNameService getClassNameService() {
381 return classNameService;
382 }
383
384
389 public void setClassNameService(
390 com.liferay.portal.service.ClassNameService classNameService) {
391 this.classNameService = classNameService;
392 }
393
394
399 public ClassNamePersistence getClassNamePersistence() {
400 return classNamePersistence;
401 }
402
403
408 public void setClassNamePersistence(
409 ClassNamePersistence classNamePersistence) {
410 this.classNamePersistence = classNamePersistence;
411 }
412
413 public void afterPropertiesSet() {
414 persistedModelLocalServiceRegistry.register("com.liferay.portal.model.WebDAVProps",
415 webDAVPropsLocalService);
416 }
417
418 public void destroy() {
419 persistedModelLocalServiceRegistry.unregister(
420 "com.liferay.portal.model.WebDAVProps");
421 }
422
423
428 @Override
429 public String getBeanIdentifier() {
430 return _beanIdentifier;
431 }
432
433
438 @Override
439 public void setBeanIdentifier(String beanIdentifier) {
440 _beanIdentifier = beanIdentifier;
441 }
442
443 protected Class<?> getModelClass() {
444 return WebDAVProps.class;
445 }
446
447 protected String getModelClassName() {
448 return WebDAVProps.class.getName();
449 }
450
451
456 protected void runSQL(String sql) {
457 try {
458 DataSource dataSource = webDAVPropsPersistence.getDataSource();
459
460 DB db = DBFactoryUtil.getDB();
461
462 sql = db.buildSQL(sql);
463 sql = PortalUtil.transformSQL(sql);
464
465 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
466 sql, new int[0]);
467
468 sqlUpdate.update();
469 }
470 catch (Exception e) {
471 throw new SystemException(e);
472 }
473 }
474
475 @BeanReference(type = com.liferay.portal.service.WebDAVPropsLocalService.class)
476 protected com.liferay.portal.service.WebDAVPropsLocalService webDAVPropsLocalService;
477 @BeanReference(type = WebDAVPropsPersistence.class)
478 protected WebDAVPropsPersistence webDAVPropsPersistence;
479 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
480 protected com.liferay.counter.service.CounterLocalService counterLocalService;
481 @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
482 protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
483 @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
484 protected com.liferay.portal.service.ClassNameService classNameService;
485 @BeanReference(type = ClassNamePersistence.class)
486 protected ClassNamePersistence classNamePersistence;
487 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
488 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
489 private String _beanIdentifier;
490 }