CCM NG: Im/Exporter for CcmApplication
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5708 8810af33-2d31-482b-a856-94f89814c4dfccm-docs
parent
869c46c856
commit
785b64781a
|
|
@ -0,0 +1,55 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2018 LibreCCM Foundation.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
package org.libreccm.web;
|
||||||
|
|
||||||
|
import org.libreccm.imexport.AbstractEntityImExporter;
|
||||||
|
import org.libreccm.imexport.Processes;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Processes(CcmApplication.class)
|
||||||
|
public class ApplicationImExporter
|
||||||
|
extends AbstractEntityImExporter<CcmApplication>{
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private ApplicationRepository applicationRepository;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Class<CcmApplication> getEntityClass() {
|
||||||
|
|
||||||
|
return CcmApplication.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
protected void saveImportedEntity(final CcmApplication entity) {
|
||||||
|
|
||||||
|
applicationRepository.save(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -81,7 +81,8 @@ import javax.persistence.Table;
|
||||||
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class,
|
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||||
resolver = ApplicationIdResolver.class,
|
resolver = ApplicationIdResolver.class,
|
||||||
property = "uuid")
|
property = "uuid")
|
||||||
public class CcmApplication extends Resource implements Serializable, Portable, Exportable {
|
public class CcmApplication extends Resource implements Serializable,
|
||||||
|
Exportable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 9205226362368890784L;
|
private static final long serialVersionUID = 9205226362368890784L;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue