mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-15 14:03:17 +00:00
DS-3086: Optimized query and entity caching
This commit is contained in:
@@ -8,10 +8,13 @@
|
||||
package org.dspace.content;
|
||||
|
||||
import org.dspace.core.Context;
|
||||
import org.hibernate.annotations.Cache;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
import org.hibernate.proxy.HibernateProxyHelper;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
|
||||
/**
|
||||
* DSpace object that represents a metadata field, which is
|
||||
* defined by a combination of schema, element, and qualifier. Every
|
||||
@@ -23,6 +26,8 @@ import javax.persistence.*;
|
||||
* @see org.dspace.content.MetadataSchema
|
||||
*/
|
||||
@Entity
|
||||
@Cacheable
|
||||
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
|
||||
@Table(name="metadatafieldregistry")
|
||||
public class MetadataField {
|
||||
|
||||
@@ -32,7 +37,7 @@ public class MetadataField {
|
||||
@SequenceGenerator(name="metadatafieldregistry_seq", sequenceName="metadatafieldregistry_seq", allocationSize = 1, initialValue = 1)
|
||||
private int id;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "metadata_schema_id",nullable = false)
|
||||
private MetadataSchema metadataSchema;
|
||||
|
||||
|
Reference in New Issue
Block a user