mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 07:23:08 +00:00
91390: Move class ItemUuidAndRelationshipId to separate file
This commit is contained in:
@@ -20,7 +20,7 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.dspace.content.dao.RelationshipDAO.ItemUuidAndRelationshipId;
|
import org.dspace.content.dao.pojo.ItemUuidAndRelationshipId;
|
||||||
import org.dspace.content.service.EntityTypeService;
|
import org.dspace.content.service.EntityTypeService;
|
||||||
import org.dspace.content.service.MetadataFieldService;
|
import org.dspace.content.service.MetadataFieldService;
|
||||||
import org.dspace.content.service.RelationshipService;
|
import org.dspace.content.service.RelationshipService;
|
||||||
|
@@ -24,7 +24,7 @@ import org.dspace.authorize.AuthorizeException;
|
|||||||
import org.dspace.authorize.service.AuthorizeService;
|
import org.dspace.authorize.service.AuthorizeService;
|
||||||
import org.dspace.content.Relationship.LatestVersionStatus;
|
import org.dspace.content.Relationship.LatestVersionStatus;
|
||||||
import org.dspace.content.dao.RelationshipDAO;
|
import org.dspace.content.dao.RelationshipDAO;
|
||||||
import org.dspace.content.dao.RelationshipDAO.ItemUuidAndRelationshipId;
|
import org.dspace.content.dao.pojo.ItemUuidAndRelationshipId;
|
||||||
import org.dspace.content.service.EntityTypeService;
|
import org.dspace.content.service.EntityTypeService;
|
||||||
import org.dspace.content.service.ItemService;
|
import org.dspace.content.service.ItemService;
|
||||||
import org.dspace.content.service.RelationshipService;
|
import org.dspace.content.service.RelationshipService;
|
||||||
|
@@ -14,9 +14,9 @@ import java.util.UUID;
|
|||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.Relationship;
|
import org.dspace.content.Relationship;
|
||||||
import org.dspace.content.RelationshipType;
|
import org.dspace.content.RelationshipType;
|
||||||
|
import org.dspace.content.dao.pojo.ItemUuidAndRelationshipId;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.dspace.core.GenericDAO;
|
import org.dspace.core.GenericDAO;
|
||||||
import org.springframework.lang.NonNull;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Database Access Object Interface class for the Relationship object
|
* Database Access Object Interface class for the Relationship object
|
||||||
@@ -130,29 +130,6 @@ public interface RelationshipDAO extends GenericDAO<Relationship> {
|
|||||||
boolean excludeNonLatest
|
boolean excludeNonLatest
|
||||||
) throws SQLException;
|
) throws SQLException;
|
||||||
|
|
||||||
/**
|
|
||||||
* Used by {@link #findByLatestItemAndRelationshipType} to avoid creating {@link Relationship}s.
|
|
||||||
*/
|
|
||||||
class ItemUuidAndRelationshipId {
|
|
||||||
|
|
||||||
private final UUID itemUuid;
|
|
||||||
private final int relationshipId;
|
|
||||||
|
|
||||||
public ItemUuidAndRelationshipId(@NonNull UUID itemUuid, @NonNull int relationshipId) {
|
|
||||||
this.itemUuid = itemUuid;
|
|
||||||
this.relationshipId = relationshipId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public UUID getItemUuid() {
|
|
||||||
return this.itemUuid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getRelationshipId() {
|
|
||||||
return this.relationshipId;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns the UUIDs of all items that have a relationship with the given item, from the perspective
|
* This method returns the UUIDs of all items that have a relationship with the given item, from the perspective
|
||||||
* of the other item. In other words, given a relationship with the given item, the given item should have
|
* of the other item. In other words, given a relationship with the given item, the given item should have
|
||||||
|
@@ -26,6 +26,7 @@ import org.dspace.content.RelationshipType;
|
|||||||
import org.dspace.content.RelationshipType_;
|
import org.dspace.content.RelationshipType_;
|
||||||
import org.dspace.content.Relationship_;
|
import org.dspace.content.Relationship_;
|
||||||
import org.dspace.content.dao.RelationshipDAO;
|
import org.dspace.content.dao.RelationshipDAO;
|
||||||
|
import org.dspace.content.dao.pojo.ItemUuidAndRelationshipId;
|
||||||
import org.dspace.content.factory.ContentServiceFactory;
|
import org.dspace.content.factory.ContentServiceFactory;
|
||||||
import org.dspace.content.service.RelationshipTypeService;
|
import org.dspace.content.service.RelationshipTypeService;
|
||||||
import org.dspace.core.AbstractHibernateDAO;
|
import org.dspace.core.AbstractHibernateDAO;
|
||||||
|
@@ -0,0 +1,37 @@
|
|||||||
|
/**
|
||||||
|
* The contents of this file are subject to the license and copyright
|
||||||
|
* detailed in the LICENSE and NOTICE files at the root of the source
|
||||||
|
* tree and available online at
|
||||||
|
*
|
||||||
|
* http://www.dspace.org/license/
|
||||||
|
*/
|
||||||
|
package org.dspace.content.dao.pojo;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import org.dspace.content.Relationship;
|
||||||
|
import org.dspace.content.dao.RelationshipDAO;
|
||||||
|
import org.springframework.lang.NonNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used by {@link RelationshipDAO#findByLatestItemAndRelationshipType} to avoid creating {@link Relationship}s.
|
||||||
|
*/
|
||||||
|
public class ItemUuidAndRelationshipId {
|
||||||
|
|
||||||
|
private final UUID itemUuid;
|
||||||
|
private final int relationshipId;
|
||||||
|
|
||||||
|
public ItemUuidAndRelationshipId(@NonNull UUID itemUuid, @NonNull int relationshipId) {
|
||||||
|
this.itemUuid = itemUuid;
|
||||||
|
this.relationshipId = relationshipId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID getItemUuid() {
|
||||||
|
return this.itemUuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRelationshipId() {
|
||||||
|
return this.relationshipId;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -16,7 +16,7 @@ import org.dspace.content.Item;
|
|||||||
import org.dspace.content.Relationship;
|
import org.dspace.content.Relationship;
|
||||||
import org.dspace.content.Relationship.LatestVersionStatus;
|
import org.dspace.content.Relationship.LatestVersionStatus;
|
||||||
import org.dspace.content.RelationshipType;
|
import org.dspace.content.RelationshipType;
|
||||||
import org.dspace.content.dao.RelationshipDAO.ItemUuidAndRelationshipId;
|
import org.dspace.content.dao.pojo.ItemUuidAndRelationshipId;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.dspace.service.DSpaceCRUDService;
|
import org.dspace.service.DSpaceCRUDService;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user