Example usage for com.liferay.portal.kernel.dao.orm Session delete

List of usage examples for com.liferay.portal.kernel.dao.orm Session delete

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.dao.orm Session delete.

Prototype

public void delete(Object object) throws ORMException;

Source Link

Usage

From source file:at.bibbox.reactjsservice.service.persistence.ToolInformationPersistenceImpl.java

License:Open Source License

@Override
protected ToolInformation removeImpl(ToolInformation toolInformation) throws SystemException {
    toolInformation = toUnwrappedModel(toolInformation);

    Session session = null;

    try {//from   w  w  w . ja  v  a  2s  . c o m
        session = openSession();

        if (!session.contains(toolInformation)) {
            toolInformation = (ToolInformation) session.get(ToolInformationImpl.class,
                    toolInformation.getPrimaryKeyObj());
        }

        if (toolInformation != null) {
            session.delete(toolInformation);
        }
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }

    if (toolInformation != null) {
        clearCache(toolInformation);
    }

    return toolInformation;
}

From source file:at.graz.hmmc.liferay.portlet.puch.service.persistence.ConfigurationPersistenceImpl.java

License:Open Source License

@Override
protected Configuration removeImpl(Configuration configuration) throws SystemException {
    configuration = toUnwrappedModel(configuration);

    Session session = null;

    try {//from   w w  w. j a v  a 2 s  . c o  m
        session = openSession();

        if (!session.contains(configuration)) {
            configuration = (Configuration) session.get(ConfigurationImpl.class,
                    configuration.getPrimaryKeyObj());
        }

        if (configuration != null) {
            session.delete(configuration);
        }
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }

    if (configuration != null) {
        clearCache(configuration);
    }

    return configuration;
}

From source file:at.graz.hmmc.liferay.portlet.puch.service.persistence.FahrzeugPersistenceImpl.java

License:Open Source License

@Override
protected Fahrzeug removeImpl(Fahrzeug fahrzeug) throws SystemException {
    fahrzeug = toUnwrappedModel(fahrzeug);

    Session session = null;

    try {// w w w  .j  a  v a  2  s. c  om
        session = openSession();

        if (!session.contains(fahrzeug)) {
            fahrzeug = (Fahrzeug) session.get(FahrzeugImpl.class, fahrzeug.getPrimaryKeyObj());
        }

        if (fahrzeug != null) {
            session.delete(fahrzeug);
        }
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }

    if (fahrzeug != null) {
        clearCache(fahrzeug);
    }

    return fahrzeug;
}

From source file:at.graz.hmmc.liferay.portlet.puch.service.persistence.ObjectDataPersistenceImpl.java

License:Open Source License

@Override
protected ObjectData removeImpl(ObjectData objectData) throws SystemException {
    objectData = toUnwrappedModel(objectData);

    Session session = null;

    try {//from  w ww  . jav  a2  s .  c  om
        session = openSession();

        if (!session.contains(objectData)) {
            objectData = (ObjectData) session.get(ObjectDataImpl.class, objectData.getPrimaryKeyObj());
        }

        if (objectData != null) {
            session.delete(objectData);
        }
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }

    if (objectData != null) {
        clearCache(objectData);
    }

    return objectData;
}

From source file:at.graz.hmmc.liferay.portlet.puch.service.persistence.ObjectImagePersistenceImpl.java

License:Open Source License

@Override
protected ObjectImage removeImpl(ObjectImage objectImage) throws SystemException {
    objectImage = toUnwrappedModel(objectImage);

    Session session = null;

    try {/*  w  w w  .j  a  v  a2  s  . c  o  m*/
        session = openSession();

        if (!session.contains(objectImage)) {
            objectImage = (ObjectImage) session.get(ObjectImageImpl.class, objectImage.getPrimaryKeyObj());
        }

        if (objectImage != null) {
            session.delete(objectImage);
        }
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }

    if (objectImage != null) {
        clearCache(objectImage);
    }

    return objectImage;
}

From source file:at.graz.hmmc.liferay.portlet.puch.service.persistence.ParameterConfigurationPersistenceImpl.java

License:Open Source License

@Override
protected ParameterConfiguration removeImpl(ParameterConfiguration parameterConfiguration)
        throws SystemException {
    parameterConfiguration = toUnwrappedModel(parameterConfiguration);

    Session session = null;

    try {//from   w ww  . java  2s  . co  m
        session = openSession();

        if (!session.contains(parameterConfiguration)) {
            parameterConfiguration = (ParameterConfiguration) session.get(ParameterConfigurationImpl.class,
                    parameterConfiguration.getPrimaryKeyObj());
        }

        if (parameterConfiguration != null) {
            session.delete(parameterConfiguration);
        }
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }

    if (parameterConfiguration != null) {
        clearCache(parameterConfiguration);
    }

    return parameterConfiguration;
}

From source file:at.graz.hmmc.liferay.portlet.puch.service.persistence.ParameterOptionsConfigurationPersistenceImpl.java

License:Open Source License

@Override
protected ParameterOptionsConfiguration removeImpl(ParameterOptionsConfiguration parameterOptionsConfiguration)
        throws SystemException {
    parameterOptionsConfiguration = toUnwrappedModel(parameterOptionsConfiguration);

    Session session = null;

    try {//from  w w w  .j a  v a2s  . c om
        session = openSession();

        if (!session.contains(parameterOptionsConfiguration)) {
            parameterOptionsConfiguration = (ParameterOptionsConfiguration) session.get(
                    ParameterOptionsConfigurationImpl.class, parameterOptionsConfiguration.getPrimaryKeyObj());
        }

        if (parameterOptionsConfiguration != null) {
            session.delete(parameterOptionsConfiguration);
        }
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }

    if (parameterOptionsConfiguration != null) {
        clearCache(parameterOptionsConfiguration);
    }

    return parameterOptionsConfiguration;
}

From source file:at.graz.hmmc.liferay.portlet.puch.service.persistence.PersonPersistenceImpl.java

License:Open Source License

@Override
protected Person removeImpl(Person person) throws SystemException {
    person = toUnwrappedModel(person);/*from  w w w.j  a va 2  s.  co m*/

    Session session = null;

    try {
        session = openSession();

        if (!session.contains(person)) {
            person = (Person) session.get(PersonImpl.class, person.getPrimaryKeyObj());
        }

        if (person != null) {
            session.delete(person);
        }
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }

    if (person != null) {
        clearCache(person);
    }

    return person;
}

From source file:at.graz.hmmc.liferay.portlet.puch.service.persistence.PuchMuseumsObjektPersistenceImpl.java

License:Open Source License

@Override
protected PuchMuseumsObjekt removeImpl(PuchMuseumsObjekt puchMuseumsObjekt) throws SystemException {
    puchMuseumsObjekt = toUnwrappedModel(puchMuseumsObjekt);

    Session session = null;

    try {/* ww  w.  j ava 2 s .  c o  m*/
        session = openSession();

        if (!session.contains(puchMuseumsObjekt)) {
            puchMuseumsObjekt = (PuchMuseumsObjekt) session.get(PuchMuseumsObjektImpl.class,
                    puchMuseumsObjekt.getPrimaryKeyObj());
        }

        if (puchMuseumsObjekt != null) {
            session.delete(puchMuseumsObjekt);
        }
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }

    if (puchMuseumsObjekt != null) {
        clearCache(puchMuseumsObjekt);
    }

    return puchMuseumsObjekt;
}

From source file:at.graz.hmmc.liferay.portlet.puch.service.persistence.TransaktionDataPersistenceImpl.java

License:Open Source License

@Override
protected TransaktionData removeImpl(TransaktionData transaktionData) throws SystemException {
    transaktionData = toUnwrappedModel(transaktionData);

    Session session = null;

    try {/*from w ww  .j a v  a  2  s.  c  o  m*/
        session = openSession();

        if (!session.contains(transaktionData)) {
            transaktionData = (TransaktionData) session.get(TransaktionDataImpl.class,
                    transaktionData.getPrimaryKeyObj());
        }

        if (transaktionData != null) {
            session.delete(transaktionData);
        }
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }

    if (transaktionData != null) {
        clearCache(transaktionData);
    }

    return transaktionData;
}