- corrects mistake in java-doc of Permission.java

[FEATURE]
- adds jpa-classes (BlobObject, File, Folder, RecentUpdatedDocsPortlet, Repository, ResourceImpl) to ccm-docrepo

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@3609 8810af33-2d31-482b-a856-94f89814c4df
pull/2/head
tosmers 2015-09-10 16:27:06 +00:00
parent 10ac5a69a2
commit 3351579875
7 changed files with 334 additions and 1 deletions

View File

@ -107,7 +107,7 @@ public class Permission implements Serializable {
/**
* The {@link Subject} (a {@link User} or a {@link Group}) to which the
* permission is granted. If the permission is granted to a {@link Group} a
* permission is granted. If the permission is granted to a {@link Group} all
* {@link User}s in that have the permission.
*/
@ManyToOne

View File

@ -0,0 +1,114 @@
/*
* 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.hibernate.validator.constraints.NotEmpty;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Blob;
import java.util.Objects;
/**
*
* @author <a href="mailto:tosmers@uni-bremen.de">Tobias Osmers</a>
*/
@Entity
@Table(schema = "ccm-docrepo", name = "blob_objects")
public class BlobObject implements Serializable {
private static final long serialVersionUID = -7468014879548796218L;
/**
* The ID/primary key for the {@code BlobObject}. Please note that it is not
* necessary to define an additional ID on classes which extend this class.
*/
@Id
@Column(name = "blob_object_id")
@GeneratedValue(strategy = GenerationType.AUTO)
private long blobObjectId;
/**
* The Content of the blob-object.
*/
@Column(name = "content")
@NotEmpty
private Blob content;
//> Begin GETTER & SETTER
public long getBlobObjectId() {
return blobObjectId;
}
public void setBlobObjectId(long blobObjectId) {
this.blobObjectId = blobObjectId;
}
public Blob getContent() {
return content;
}
public void setContent(Blob content) {
this.content = content;
}
//< End GETTER & SETTER
@Override
public int hashCode() {
int hash = 5;
hash = 61 * hash + (int) (blobObjectId ^ (blobObjectId >>> 32));
hash = 61 * hash + Objects.hashCode(content);
return hash;
}
@Override
public boolean equals(final Object obj) {
if (obj == null) {
return false;
}
if (!(obj instanceof BlobObject)) {
return false;
}
final BlobObject other = (BlobObject) obj;
if (!other.canEqual(this)) {
return false;
}
return blobObjectId == other.getBlobObjectId() &&
Objects.equals(content, other.getContent());
}
public boolean canEqual(final Object obj) {
return obj instanceof BlobObject;
}
@Override
public String toString() {
return String.format("%s{ "
+ "blobObjectId = %d, "
+ "content = %s, "
+ " }",
super.toString(),
blobObjectId,
content.toString());
}
}

View File

@ -0,0 +1,43 @@
/*
* 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 javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
/**
*
* @author <a href="mailto:tosmers@uni-bremen.de">Tobias Osmers</a>
*/
@Entity
@Table(schema = "ccm-docrepo", name = "files")
@NamedQueries({
@NamedQuery(name = "getFileRevisionBlob",
query = "")
})
public class File extends ResourceImpl {
private static final long serialVersionUID = -504220783419811504L;
public File() {
super();
}
}

View File

@ -0,0 +1,36 @@
/*
* 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 javax.persistence.Entity;
import javax.persistence.Table;
/**
*
* @author <a href="mailto:tosmers@uni-bremen.de">Tobias Osmers</a>
*/
@Entity
@Table(schema = "ccm-docrepo", name = "folders")
public class Folder extends ResourceImpl {
private static final long serialVersionUID = 1561466556458872622L;
public Folder() {
super();
}
}

View File

@ -0,0 +1,38 @@
/*
* 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.portal.Portlet;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
*
* @author <a href="mailto:tosmers@uni-bremen.de">Tobias Osmers</a>
*/
@Entity
@Table(schema = "ccm-docrepo", name = "recent_updated_docs_portlets")
public class RecentUpdatedDocsPortlet extends Portlet {
private static final long serialVersionUID = -4091024367070127101L;
public RecentUpdatedDocsPortlet() {
super();
}
}

View File

@ -0,0 +1,73 @@
/*
* 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.web.Application;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
/**
*
* @author <a href="mailto:tosmers@uni-bremen.de">Tobias Osmers</a>
*/
@Entity
@Table(schema = "ccm-docrepo", name = "repositories")
@NamedQueries({
@NamedQuery(name = "getRepositoryRoots",
query = "")
})
public class Repository extends Application {
private static final long serialVersionUID = 6673243021462798036L;
@Column(name = "root_id")
private long rootId;
@Column(name = "owner_id")
private long ownerId;
public Repository() {
super();
}
//> Begin GETTER & SETTER
public long getRootId() {
return rootId;
}
public void setRootId(long rootId) {
this.rootId = rootId;
}
public long getOwnerId() {
return ownerId;
}
public void setOwnerId(long ownerId) {
this.ownerId = ownerId;
}
//< End GETTER & SETTER
}

View File

@ -0,0 +1,29 @@
/*
* 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 java.io.Serializable;
/**
*
* @author <a href="mailto:tosmers@uni-bremen.de">Tobias Osmers</a>
*/
public class ResourceImpl implements Serializable{
private static final long serialVersionUID = -910317798106611214L;
}