[UPDATE]
- renames java class ResourceImpl to Resource - adds java class ResourceRepository git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@3635 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
5146d1611e
commit
a3f58755bd
|
|
@ -23,13 +23,13 @@ import javax.persistence.Table;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Entity class for a file in the doc-repository. Instances will be persisted
|
* Entity class for a file in the doc-repository. Instances will be persisted
|
||||||
* into the database. Instance variables are inherited from {@link ResourceImpl}.
|
* into the database. Instance variables are inherited from {@link Resource}.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:tosmers@uni-bremen.de">Tobias Osmers</a>
|
* @author <a href="mailto:tosmers@uni-bremen.de">Tobias Osmers</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(schema = "CCM_DOCREPO", name = "FILES")
|
@Table(schema = "CCM_DOCREPO", name = "FILES")
|
||||||
public class File extends ResourceImpl {
|
public class File extends Resource {
|
||||||
|
|
||||||
private static final long serialVersionUID = -504220783419811504L;
|
private static final long serialVersionUID = -504220783419811504L;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,13 @@ import javax.persistence.Table;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Entity class of a folder in the doc-repository. Instances will be persisted
|
* Entity class of a folder in the doc-repository. Instances will be persisted
|
||||||
* into the database. Instance variables are inherited from {@link ResourceImpl}.
|
* into the database. Instance variables are inherited from {@link Resource}.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:tosmers@uni-bremen.de">Tobias Osmers</a>
|
* @author <a href="mailto:tosmers@uni-bremen.de">Tobias Osmers</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(schema = "CCM_DOCREPO", name = "FOLDERS")
|
@Table(schema = "CCM_DOCREPO", name = "FOLDERS")
|
||||||
public class Folder extends ResourceImpl {
|
public class Folder extends Resource {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1561466556458872622L;
|
private static final long serialVersionUID = 1561466556458872622L;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,13 +21,14 @@ package org.libreccm.docrepo;
|
||||||
import org.hibernate.validator.constraints.NotBlank;
|
import org.hibernate.validator.constraints.NotBlank;
|
||||||
import org.libreccm.core.CcmObject;
|
import org.libreccm.core.CcmObject;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.OneToOne;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
import javax.persistence.TemporalType;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -40,8 +41,8 @@ import javax.persistence.TemporalType;
|
||||||
* @author <a href="mailto:tosmers@uni-bremen.de">Tobias Osmers</a>
|
* @author <a href="mailto:tosmers@uni-bremen.de">Tobias Osmers</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(schema = "CCM_DOCREPO", name = "RESOURCE_IMPL")
|
@Table(schema = "CCM_DOCREPO", name = "RESOURCES")
|
||||||
public abstract class ResourceImpl extends CcmObject {
|
public abstract class Resource extends CcmObject {
|
||||||
|
|
||||||
private static final long serialVersionUID = -910317798106611214L;
|
private static final long serialVersionUID = -910317798106611214L;
|
||||||
|
|
||||||
|
|
@ -112,7 +113,14 @@ public abstract class ResourceImpl extends CcmObject {
|
||||||
@Column(name = "LAST_MODIFIED_IP")
|
@Column(name = "LAST_MODIFIED_IP")
|
||||||
private String lastModifiedIp;
|
private String lastModifiedIp;
|
||||||
|
|
||||||
public ResourceImpl() {
|
@OneToOne
|
||||||
|
@JoinColumn(name = "CONTENT_RESOURCE_ID")
|
||||||
|
private Resource contentResource;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public Resource() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2015 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.docrepo;
|
||||||
|
|
||||||
|
|
||||||
|
import org.libreccm.auditing.AbstractAuditedEntityRepository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:tosmers@uni-bremen.de">Tobias Osmers</a>
|
||||||
|
*/
|
||||||
|
public class ResourceRepository extends AbstractAuditedEntityRepository<Long, Resource> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getEntityId(Resource entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<Resource> getEntityClass() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNew(Resource entity) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue