问题
I am doing dspace search project. Here I have created seperate item page. Now I have one problem. I am not able to retrieve collection name in in which item appears. Collection2item displays only collection id.Please help.
回答1:
Savio, thank you for clarifying that you are in DSpace 5.
The following code appears to document the migration of community.name from DSpace 4 to DSpace 5.
https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V5.0_2014.09.26__DS-1582_Metadata_For_All_Objects.sql#L133-L141
DSpace 5 introduced "metadata for all objects" and collection.name appears to be stored as a metadatavalue of "title".
回答2:
The collection name is stored in the collection table. It is linked to the item table via item.owning_collection
and collection2item
.
select collection.name
from collection
inner join item on owning_collection=collection_id
where item_id=1
来源:https://stackoverflow.com/questions/31782971/how-to-retrieve-collection-name-based-on-item