CCM NG/ccm-core: Extended JavaDoc for CcmObjectRepository
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4710 8810af33-2d31-482b-a856-94f89814c4dfccm-docs
parent
2d6a4b3266
commit
a6d8836bc4
|
|
@ -28,7 +28,14 @@ import java.util.UUID;
|
||||||
import static org.libreccm.core.CoreConstants.ACCESS_DENIED;
|
import static org.libreccm.core.CoreConstants.ACCESS_DENIED;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A repository class for {@link CcmObject}.
|
* A repository class for {@link CcmObject} entities.
|
||||||
|
*
|
||||||
|
* Please note that the {@code CcmObjectRepository} does not do any
|
||||||
|
* authorisation checks. {@code CcmObjectRepository} can't do that because the
|
||||||
|
* permissions are application specific. Checking permissions is the
|
||||||
|
* responsibility of the developers which use this class. It is recommended the
|
||||||
|
* create a repository class for each entity type which performs the
|
||||||
|
* applications specific permission checks.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
|
|
@ -48,7 +55,7 @@ public class CcmObjectRepository extends AbstractEntityRepository<Long, CcmObjec
|
||||||
|
|
||||||
if (ACCESS_DENIED.equals(entity.getDisplayName())) {
|
if (ACCESS_DENIED.equals(entity.getDisplayName())) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"Can't save the Access Denied object.");
|
"Can't save the Access Denied object.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return entity.getObjectId() == 0;
|
return entity.getObjectId() == 0;
|
||||||
|
|
@ -68,7 +75,7 @@ public class CcmObjectRepository extends AbstractEntityRepository<Long, CcmObjec
|
||||||
*/
|
*/
|
||||||
public Optional<CcmObject> findObjectById(final long objectId) {
|
public Optional<CcmObject> findObjectById(final long objectId) {
|
||||||
final TypedQuery<CcmObject> query = getEntityManager().createNamedQuery(
|
final TypedQuery<CcmObject> query = getEntityManager().createNamedQuery(
|
||||||
"CcmObject.findById", CcmObject.class);
|
"CcmObject.findById", CcmObject.class);
|
||||||
query.setParameter("id", objectId);
|
query.setParameter("id", objectId);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
@ -87,7 +94,7 @@ public class CcmObjectRepository extends AbstractEntityRepository<Long, CcmObjec
|
||||||
*/
|
*/
|
||||||
public Optional<CcmObject> findObjectByUuid(final String uuid) {
|
public Optional<CcmObject> findObjectByUuid(final String uuid) {
|
||||||
final TypedQuery<CcmObject> query = getEntityManager().createNamedQuery(
|
final TypedQuery<CcmObject> query = getEntityManager().createNamedQuery(
|
||||||
"CcmObject.findByUuid", CcmObject.class);
|
"CcmObject.findByUuid", CcmObject.class);
|
||||||
query.setParameter("uuid", uuid);
|
query.setParameter("uuid", uuid);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue