ru.dokstrudio.med.srv.service.base.TestUnitLocalServiceBaseImpl.java Source code

Java tutorial

Introduction

Here is the source code for ru.dokstrudio.med.srv.service.base.TestUnitLocalServiceBaseImpl.java

Source

/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package ru.dokstrudio.med.srv.service.base;

import aQute.bnd.annotation.ProviderType;

import com.liferay.portal.kernel.bean.BeanReference;
import com.liferay.portal.kernel.dao.db.DB;
import com.liferay.portal.kernel.dao.db.DBManagerUtil;
import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
import com.liferay.portal.kernel.dao.orm.Projection;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.model.PersistedModel;
import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
import com.liferay.portal.kernel.search.Indexable;
import com.liferay.portal.kernel.search.IndexableType;
import com.liferay.portal.kernel.service.BaseLocalServiceImpl;
import com.liferay.portal.kernel.service.PersistedModelLocalServiceRegistry;
import com.liferay.portal.kernel.service.persistence.ClassNamePersistence;
import com.liferay.portal.kernel.service.persistence.UserPersistence;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.PortalUtil;
import com.liferay.portal.spring.extender.service.ServiceReference;

import ru.dokstrudio.med.srv.model.TestUnit;
import ru.dokstrudio.med.srv.service.TestUnitLocalService;
import ru.dokstrudio.med.srv.service.persistence.ApplicationAccountPersistence;
import ru.dokstrudio.med.srv.service.persistence.ApplicationUsagePersistence;
import ru.dokstrudio.med.srv.service.persistence.TestUnitAnswerPersistence;
import ru.dokstrudio.med.srv.service.persistence.TestUnitAttemptPersistence;
import ru.dokstrudio.med.srv.service.persistence.TestUnitPersistence;
import ru.dokstrudio.med.srv.service.persistence.TestUnitSpecializationPersistence;
import ru.dokstrudio.med.srv.service.persistence.UserAccountPersistence;
import ru.dokstrudio.med.srv.service.persistence.UserDevicePersistence;

import java.io.Serializable;

import java.util.List;

import javax.sql.DataSource;

/**
 * Provides the base implementation for the test unit local service.
 *
 * <p>
 * This implementation exists only as a container for the default service methods generated by ServiceBuilder. All custom service methods should be put in {@link ru.dokstrudio.med.srv.service.impl.TestUnitLocalServiceImpl}.
 * </p>
 *
 * @author Brian Wing Shun Chan
 * @see ru.dokstrudio.med.srv.service.impl.TestUnitLocalServiceImpl
 * @see ru.dokstrudio.med.srv.service.TestUnitLocalServiceUtil
 * @generated
 */
@ProviderType
public abstract class TestUnitLocalServiceBaseImpl extends BaseLocalServiceImpl
        implements TestUnitLocalService, IdentifiableOSGiService {
    /*
     * NOTE FOR DEVELOPERS:
     *
     * Never modify or reference this class directly. Always use {@link ru.dokstrudio.med.srv.service.TestUnitLocalServiceUtil} to access the test unit local service.
     */

    /**
     * Adds the test unit to the database. Also notifies the appropriate model listeners.
     *
     * @param testUnit the test unit
     * @return the test unit that was added
     */
    @Indexable(type = IndexableType.REINDEX)
    @Override
    public TestUnit addTestUnit(TestUnit testUnit) {
        testUnit.setNew(true);

        return testUnitPersistence.update(testUnit);
    }

    /**
     * Creates a new test unit with the primary key. Does not add the test unit to the database.
     *
     * @param testUnitId the primary key for the new test unit
     * @return the new test unit
     */
    @Override
    public TestUnit createTestUnit(long testUnitId) {
        return testUnitPersistence.create(testUnitId);
    }

    /**
     * Deletes the test unit with the primary key from the database. Also notifies the appropriate model listeners.
     *
     * @param testUnitId the primary key of the test unit
     * @return the test unit that was removed
     * @throws PortalException if a test unit with the primary key could not be found
     */
    @Indexable(type = IndexableType.DELETE)
    @Override
    public TestUnit deleteTestUnit(long testUnitId) throws PortalException {
        return testUnitPersistence.remove(testUnitId);
    }

    /**
     * Deletes the test unit from the database. Also notifies the appropriate model listeners.
     *
     * @param testUnit the test unit
     * @return the test unit that was removed
     */
    @Indexable(type = IndexableType.DELETE)
    @Override
    public TestUnit deleteTestUnit(TestUnit testUnit) {
        return testUnitPersistence.remove(testUnit);
    }

    @Override
    public DynamicQuery dynamicQuery() {
        Class<?> clazz = getClass();

        return DynamicQueryFactoryUtil.forClass(TestUnit.class, clazz.getClassLoader());
    }

    /**
     * Performs a dynamic query on the database and returns the matching rows.
     *
     * @param dynamicQuery the dynamic query
     * @return the matching rows
     */
    @Override
    public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
        return testUnitPersistence.findWithDynamicQuery(dynamicQuery);
    }

    /**
     * Performs a dynamic query on the database and returns a range of the matching rows.
     *
     * <p>
     * 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 ru.dokstrudio.med.srv.model.impl.TestUnitModelImpl}. 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.
     * </p>
     *
     * @param dynamicQuery the dynamic query
     * @param start the lower bound of the range of model instances
     * @param end the upper bound of the range of model instances (not inclusive)
     * @return the range of matching rows
     */
    @Override
    public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end) {
        return testUnitPersistence.findWithDynamicQuery(dynamicQuery, start, end);
    }

    /**
     * Performs a dynamic query on the database and returns an ordered range of the matching rows.
     *
     * <p>
     * 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 ru.dokstrudio.med.srv.model.impl.TestUnitModelImpl}. 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.
     * </p>
     *
     * @param dynamicQuery the dynamic query
     * @param start the lower bound of the range of model instances
     * @param end the upper bound of the range of model instances (not inclusive)
     * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
     * @return the ordered range of matching rows
     */
    @Override
    public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
            OrderByComparator<T> orderByComparator) {
        return testUnitPersistence.findWithDynamicQuery(dynamicQuery, start, end, orderByComparator);
    }

    /**
     * Returns the number of rows matching the dynamic query.
     *
     * @param dynamicQuery the dynamic query
     * @return the number of rows matching the dynamic query
     */
    @Override
    public long dynamicQueryCount(DynamicQuery dynamicQuery) {
        return testUnitPersistence.countWithDynamicQuery(dynamicQuery);
    }

    /**
     * Returns the number of rows matching the dynamic query.
     *
     * @param dynamicQuery the dynamic query
     * @param projection the projection to apply to the query
     * @return the number of rows matching the dynamic query
     */
    @Override
    public long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection) {
        return testUnitPersistence.countWithDynamicQuery(dynamicQuery, projection);
    }

    @Override
    public TestUnit fetchTestUnit(long testUnitId) {
        return testUnitPersistence.fetchByPrimaryKey(testUnitId);
    }

    /**
     * Returns the test unit with the primary key.
     *
     * @param testUnitId the primary key of the test unit
     * @return the test unit
     * @throws PortalException if a test unit with the primary key could not be found
     */
    @Override
    public TestUnit getTestUnit(long testUnitId) throws PortalException {
        return testUnitPersistence.findByPrimaryKey(testUnitId);
    }

    @Override
    public ActionableDynamicQuery getActionableDynamicQuery() {
        ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();

        actionableDynamicQuery.setBaseLocalService(testUnitLocalService);
        actionableDynamicQuery.setClassLoader(getClassLoader());
        actionableDynamicQuery.setModelClass(TestUnit.class);

        actionableDynamicQuery.setPrimaryKeyPropertyName("testUnitId");

        return actionableDynamicQuery;
    }

    @Override
    public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
        IndexableActionableDynamicQuery indexableActionableDynamicQuery = new IndexableActionableDynamicQuery();

        indexableActionableDynamicQuery.setBaseLocalService(testUnitLocalService);
        indexableActionableDynamicQuery.setClassLoader(getClassLoader());
        indexableActionableDynamicQuery.setModelClass(TestUnit.class);

        indexableActionableDynamicQuery.setPrimaryKeyPropertyName("testUnitId");

        return indexableActionableDynamicQuery;
    }

    protected void initActionableDynamicQuery(ActionableDynamicQuery actionableDynamicQuery) {
        actionableDynamicQuery.setBaseLocalService(testUnitLocalService);
        actionableDynamicQuery.setClassLoader(getClassLoader());
        actionableDynamicQuery.setModelClass(TestUnit.class);

        actionableDynamicQuery.setPrimaryKeyPropertyName("testUnitId");
    }

    /**
     * @throws PortalException
     */
    @Override
    public PersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException {
        return testUnitLocalService.deleteTestUnit((TestUnit) persistedModel);
    }

    @Override
    public PersistedModel getPersistedModel(Serializable primaryKeyObj) throws PortalException {
        return testUnitPersistence.findByPrimaryKey(primaryKeyObj);
    }

    /**
     * Returns a range of all the test units.
     *
     * <p>
     * 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 ru.dokstrudio.med.srv.model.impl.TestUnitModelImpl}. 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.
     * </p>
     *
     * @param start the lower bound of the range of test units
     * @param end the upper bound of the range of test units (not inclusive)
     * @return the range of test units
     */
    @Override
    public List<TestUnit> getTestUnits(int start, int end) {
        return testUnitPersistence.findAll(start, end);
    }

    /**
     * Returns the number of test units.
     *
     * @return the number of test units
     */
    @Override
    public int getTestUnitsCount() {
        return testUnitPersistence.countAll();
    }

    /**
     * Updates the test unit in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
     *
     * @param testUnit the test unit
     * @return the test unit that was updated
     */
    @Indexable(type = IndexableType.REINDEX)
    @Override
    public TestUnit updateTestUnit(TestUnit testUnit) {
        return testUnitPersistence.update(testUnit);
    }

    /**
     * Returns the application account local service.
     *
     * @return the application account local service
     */
    public ru.dokstrudio.med.srv.service.ApplicationAccountLocalService getApplicationAccountLocalService() {
        return applicationAccountLocalService;
    }

    /**
     * Sets the application account local service.
     *
     * @param applicationAccountLocalService the application account local service
     */
    public void setApplicationAccountLocalService(
            ru.dokstrudio.med.srv.service.ApplicationAccountLocalService applicationAccountLocalService) {
        this.applicationAccountLocalService = applicationAccountLocalService;
    }

    /**
     * Returns the application account persistence.
     *
     * @return the application account persistence
     */
    public ApplicationAccountPersistence getApplicationAccountPersistence() {
        return applicationAccountPersistence;
    }

    /**
     * Sets the application account persistence.
     *
     * @param applicationAccountPersistence the application account persistence
     */
    public void setApplicationAccountPersistence(ApplicationAccountPersistence applicationAccountPersistence) {
        this.applicationAccountPersistence = applicationAccountPersistence;
    }

    /**
     * Returns the application usage local service.
     *
     * @return the application usage local service
     */
    public ru.dokstrudio.med.srv.service.ApplicationUsageLocalService getApplicationUsageLocalService() {
        return applicationUsageLocalService;
    }

    /**
     * Sets the application usage local service.
     *
     * @param applicationUsageLocalService the application usage local service
     */
    public void setApplicationUsageLocalService(
            ru.dokstrudio.med.srv.service.ApplicationUsageLocalService applicationUsageLocalService) {
        this.applicationUsageLocalService = applicationUsageLocalService;
    }

    /**
     * Returns the application usage persistence.
     *
     * @return the application usage persistence
     */
    public ApplicationUsagePersistence getApplicationUsagePersistence() {
        return applicationUsagePersistence;
    }

    /**
     * Sets the application usage persistence.
     *
     * @param applicationUsagePersistence the application usage persistence
     */
    public void setApplicationUsagePersistence(ApplicationUsagePersistence applicationUsagePersistence) {
        this.applicationUsagePersistence = applicationUsagePersistence;
    }

    /**
     * Returns the test unit local service.
     *
     * @return the test unit local service
     */
    public TestUnitLocalService getTestUnitLocalService() {
        return testUnitLocalService;
    }

    /**
     * Sets the test unit local service.
     *
     * @param testUnitLocalService the test unit local service
     */
    public void setTestUnitLocalService(TestUnitLocalService testUnitLocalService) {
        this.testUnitLocalService = testUnitLocalService;
    }

    /**
     * Returns the test unit persistence.
     *
     * @return the test unit persistence
     */
    public TestUnitPersistence getTestUnitPersistence() {
        return testUnitPersistence;
    }

    /**
     * Sets the test unit persistence.
     *
     * @param testUnitPersistence the test unit persistence
     */
    public void setTestUnitPersistence(TestUnitPersistence testUnitPersistence) {
        this.testUnitPersistence = testUnitPersistence;
    }

    /**
     * Returns the test unit answer local service.
     *
     * @return the test unit answer local service
     */
    public ru.dokstrudio.med.srv.service.TestUnitAnswerLocalService getTestUnitAnswerLocalService() {
        return testUnitAnswerLocalService;
    }

    /**
     * Sets the test unit answer local service.
     *
     * @param testUnitAnswerLocalService the test unit answer local service
     */
    public void setTestUnitAnswerLocalService(
            ru.dokstrudio.med.srv.service.TestUnitAnswerLocalService testUnitAnswerLocalService) {
        this.testUnitAnswerLocalService = testUnitAnswerLocalService;
    }

    /**
     * Returns the test unit answer persistence.
     *
     * @return the test unit answer persistence
     */
    public TestUnitAnswerPersistence getTestUnitAnswerPersistence() {
        return testUnitAnswerPersistence;
    }

    /**
     * Sets the test unit answer persistence.
     *
     * @param testUnitAnswerPersistence the test unit answer persistence
     */
    public void setTestUnitAnswerPersistence(TestUnitAnswerPersistence testUnitAnswerPersistence) {
        this.testUnitAnswerPersistence = testUnitAnswerPersistence;
    }

    /**
     * Returns the test unit attempt local service.
     *
     * @return the test unit attempt local service
     */
    public ru.dokstrudio.med.srv.service.TestUnitAttemptLocalService getTestUnitAttemptLocalService() {
        return testUnitAttemptLocalService;
    }

    /**
     * Sets the test unit attempt local service.
     *
     * @param testUnitAttemptLocalService the test unit attempt local service
     */
    public void setTestUnitAttemptLocalService(
            ru.dokstrudio.med.srv.service.TestUnitAttemptLocalService testUnitAttemptLocalService) {
        this.testUnitAttemptLocalService = testUnitAttemptLocalService;
    }

    /**
     * Returns the test unit attempt persistence.
     *
     * @return the test unit attempt persistence
     */
    public TestUnitAttemptPersistence getTestUnitAttemptPersistence() {
        return testUnitAttemptPersistence;
    }

    /**
     * Sets the test unit attempt persistence.
     *
     * @param testUnitAttemptPersistence the test unit attempt persistence
     */
    public void setTestUnitAttemptPersistence(TestUnitAttemptPersistence testUnitAttemptPersistence) {
        this.testUnitAttemptPersistence = testUnitAttemptPersistence;
    }

    /**
     * Returns the test unit specialization local service.
     *
     * @return the test unit specialization local service
     */
    public ru.dokstrudio.med.srv.service.TestUnitSpecializationLocalService getTestUnitSpecializationLocalService() {
        return testUnitSpecializationLocalService;
    }

    /**
     * Sets the test unit specialization local service.
     *
     * @param testUnitSpecializationLocalService the test unit specialization local service
     */
    public void setTestUnitSpecializationLocalService(
            ru.dokstrudio.med.srv.service.TestUnitSpecializationLocalService testUnitSpecializationLocalService) {
        this.testUnitSpecializationLocalService = testUnitSpecializationLocalService;
    }

    /**
     * Returns the test unit specialization persistence.
     *
     * @return the test unit specialization persistence
     */
    public TestUnitSpecializationPersistence getTestUnitSpecializationPersistence() {
        return testUnitSpecializationPersistence;
    }

    /**
     * Sets the test unit specialization persistence.
     *
     * @param testUnitSpecializationPersistence the test unit specialization persistence
     */
    public void setTestUnitSpecializationPersistence(
            TestUnitSpecializationPersistence testUnitSpecializationPersistence) {
        this.testUnitSpecializationPersistence = testUnitSpecializationPersistence;
    }

    /**
     * Returns the user account local service.
     *
     * @return the user account local service
     */
    public ru.dokstrudio.med.srv.service.UserAccountLocalService getUserAccountLocalService() {
        return userAccountLocalService;
    }

    /**
     * Sets the user account local service.
     *
     * @param userAccountLocalService the user account local service
     */
    public void setUserAccountLocalService(
            ru.dokstrudio.med.srv.service.UserAccountLocalService userAccountLocalService) {
        this.userAccountLocalService = userAccountLocalService;
    }

    /**
     * Returns the user account persistence.
     *
     * @return the user account persistence
     */
    public UserAccountPersistence getUserAccountPersistence() {
        return userAccountPersistence;
    }

    /**
     * Sets the user account persistence.
     *
     * @param userAccountPersistence the user account persistence
     */
    public void setUserAccountPersistence(UserAccountPersistence userAccountPersistence) {
        this.userAccountPersistence = userAccountPersistence;
    }

    /**
     * Returns the user device local service.
     *
     * @return the user device local service
     */
    public ru.dokstrudio.med.srv.service.UserDeviceLocalService getUserDeviceLocalService() {
        return userDeviceLocalService;
    }

    /**
     * Sets the user device local service.
     *
     * @param userDeviceLocalService the user device local service
     */
    public void setUserDeviceLocalService(
            ru.dokstrudio.med.srv.service.UserDeviceLocalService userDeviceLocalService) {
        this.userDeviceLocalService = userDeviceLocalService;
    }

    /**
     * Returns the user device persistence.
     *
     * @return the user device persistence
     */
    public UserDevicePersistence getUserDevicePersistence() {
        return userDevicePersistence;
    }

    /**
     * Sets the user device persistence.
     *
     * @param userDevicePersistence the user device persistence
     */
    public void setUserDevicePersistence(UserDevicePersistence userDevicePersistence) {
        this.userDevicePersistence = userDevicePersistence;
    }

    /**
     * Returns the counter local service.
     *
     * @return the counter local service
     */
    public com.liferay.counter.kernel.service.CounterLocalService getCounterLocalService() {
        return counterLocalService;
    }

    /**
     * Sets the counter local service.
     *
     * @param counterLocalService the counter local service
     */
    public void setCounterLocalService(com.liferay.counter.kernel.service.CounterLocalService counterLocalService) {
        this.counterLocalService = counterLocalService;
    }

    /**
     * Returns the class name local service.
     *
     * @return the class name local service
     */
    public com.liferay.portal.kernel.service.ClassNameLocalService getClassNameLocalService() {
        return classNameLocalService;
    }

    /**
     * Sets the class name local service.
     *
     * @param classNameLocalService the class name local service
     */
    public void setClassNameLocalService(
            com.liferay.portal.kernel.service.ClassNameLocalService classNameLocalService) {
        this.classNameLocalService = classNameLocalService;
    }

    /**
     * Returns the class name persistence.
     *
     * @return the class name persistence
     */
    public ClassNamePersistence getClassNamePersistence() {
        return classNamePersistence;
    }

    /**
     * Sets the class name persistence.
     *
     * @param classNamePersistence the class name persistence
     */
    public void setClassNamePersistence(ClassNamePersistence classNamePersistence) {
        this.classNamePersistence = classNamePersistence;
    }

    /**
     * Returns the resource local service.
     *
     * @return the resource local service
     */
    public com.liferay.portal.kernel.service.ResourceLocalService getResourceLocalService() {
        return resourceLocalService;
    }

    /**
     * Sets the resource local service.
     *
     * @param resourceLocalService the resource local service
     */
    public void setResourceLocalService(
            com.liferay.portal.kernel.service.ResourceLocalService resourceLocalService) {
        this.resourceLocalService = resourceLocalService;
    }

    /**
     * Returns the user local service.
     *
     * @return the user local service
     */
    public com.liferay.portal.kernel.service.UserLocalService getUserLocalService() {
        return userLocalService;
    }

    /**
     * Sets the user local service.
     *
     * @param userLocalService the user local service
     */
    public void setUserLocalService(com.liferay.portal.kernel.service.UserLocalService userLocalService) {
        this.userLocalService = userLocalService;
    }

    /**
     * Returns the user persistence.
     *
     * @return the user persistence
     */
    public UserPersistence getUserPersistence() {
        return userPersistence;
    }

    /**
     * Sets the user persistence.
     *
     * @param userPersistence the user persistence
     */
    public void setUserPersistence(UserPersistence userPersistence) {
        this.userPersistence = userPersistence;
    }

    public void afterPropertiesSet() {
        persistedModelLocalServiceRegistry.register("ru.dokstrudio.med.srv.model.TestUnit", testUnitLocalService);
    }

    public void destroy() {
        persistedModelLocalServiceRegistry.unregister("ru.dokstrudio.med.srv.model.TestUnit");
    }

    /**
     * Returns the OSGi service identifier.
     *
     * @return the OSGi service identifier
     */
    @Override
    public String getOSGiServiceIdentifier() {
        return TestUnitLocalService.class.getName();
    }

    protected Class<?> getModelClass() {
        return TestUnit.class;
    }

    protected String getModelClassName() {
        return TestUnit.class.getName();
    }

    /**
     * Performs a SQL query.
     *
     * @param sql the sql query
     */
    protected void runSQL(String sql) {
        try {
            DataSource dataSource = testUnitPersistence.getDataSource();

            DB db = DBManagerUtil.getDB();

            sql = db.buildSQL(sql);
            sql = PortalUtil.transformSQL(sql);

            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource, sql);

            sqlUpdate.update();
        } catch (Exception e) {
            throw new SystemException(e);
        }
    }

    @BeanReference(type = ru.dokstrudio.med.srv.service.ApplicationAccountLocalService.class)
    protected ru.dokstrudio.med.srv.service.ApplicationAccountLocalService applicationAccountLocalService;
    @BeanReference(type = ApplicationAccountPersistence.class)
    protected ApplicationAccountPersistence applicationAccountPersistence;
    @BeanReference(type = ru.dokstrudio.med.srv.service.ApplicationUsageLocalService.class)
    protected ru.dokstrudio.med.srv.service.ApplicationUsageLocalService applicationUsageLocalService;
    @BeanReference(type = ApplicationUsagePersistence.class)
    protected ApplicationUsagePersistence applicationUsagePersistence;
    @BeanReference(type = TestUnitLocalService.class)
    protected TestUnitLocalService testUnitLocalService;
    @BeanReference(type = TestUnitPersistence.class)
    protected TestUnitPersistence testUnitPersistence;
    @BeanReference(type = ru.dokstrudio.med.srv.service.TestUnitAnswerLocalService.class)
    protected ru.dokstrudio.med.srv.service.TestUnitAnswerLocalService testUnitAnswerLocalService;
    @BeanReference(type = TestUnitAnswerPersistence.class)
    protected TestUnitAnswerPersistence testUnitAnswerPersistence;
    @BeanReference(type = ru.dokstrudio.med.srv.service.TestUnitAttemptLocalService.class)
    protected ru.dokstrudio.med.srv.service.TestUnitAttemptLocalService testUnitAttemptLocalService;
    @BeanReference(type = TestUnitAttemptPersistence.class)
    protected TestUnitAttemptPersistence testUnitAttemptPersistence;
    @BeanReference(type = ru.dokstrudio.med.srv.service.TestUnitSpecializationLocalService.class)
    protected ru.dokstrudio.med.srv.service.TestUnitSpecializationLocalService testUnitSpecializationLocalService;
    @BeanReference(type = TestUnitSpecializationPersistence.class)
    protected TestUnitSpecializationPersistence testUnitSpecializationPersistence;
    @BeanReference(type = ru.dokstrudio.med.srv.service.UserAccountLocalService.class)
    protected ru.dokstrudio.med.srv.service.UserAccountLocalService userAccountLocalService;
    @BeanReference(type = UserAccountPersistence.class)
    protected UserAccountPersistence userAccountPersistence;
    @BeanReference(type = ru.dokstrudio.med.srv.service.UserDeviceLocalService.class)
    protected ru.dokstrudio.med.srv.service.UserDeviceLocalService userDeviceLocalService;
    @BeanReference(type = UserDevicePersistence.class)
    protected UserDevicePersistence userDevicePersistence;
    @ServiceReference(type = com.liferay.counter.kernel.service.CounterLocalService.class)
    protected com.liferay.counter.kernel.service.CounterLocalService counterLocalService;
    @ServiceReference(type = com.liferay.portal.kernel.service.ClassNameLocalService.class)
    protected com.liferay.portal.kernel.service.ClassNameLocalService classNameLocalService;
    @ServiceReference(type = ClassNamePersistence.class)
    protected ClassNamePersistence classNamePersistence;
    @ServiceReference(type = com.liferay.portal.kernel.service.ResourceLocalService.class)
    protected com.liferay.portal.kernel.service.ResourceLocalService resourceLocalService;
    @ServiceReference(type = com.liferay.portal.kernel.service.UserLocalService.class)
    protected com.liferay.portal.kernel.service.UserLocalService userLocalService;
    @ServiceReference(type = UserPersistence.class)
    protected UserPersistence userPersistence;
    @ServiceReference(type = PersistedModelLocalServiceRegistry.class)
    protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
}