Removing joins from DMP <-> EntityDoiEntity

This commit is contained in:
Thomas Georgios Giannos 2023-10-19 12:41:47 +03:00
parent a235eb98f4
commit 07ff58fbd9
2 changed files with 4 additions and 3 deletions

View File

@ -54,8 +54,7 @@ public class EntityDoiEntity {
public static final String _isActive = "isActive";
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "entity_id", nullable = false)
@Column(name = "entity_id", columnDefinition = "BINARY(16)")
private UUID entityId;
public static final String _entityId = "entityId";

View File

@ -183,7 +183,8 @@ public class DMP implements DataEntity<DMP, UUID> {
@Convert(converter = DateToUTCConverter.class)
private Date publishedAt;
@OneToMany(mappedBy = "entityId", fetch = FetchType.LAZY)
// @OneToMany(mappedBy = "entityId", fetch = FetchType.LAZY)
@Transient
private Set<EntityDoiEntity> dois;
@ManyToOne(fetch = FetchType.LAZY)
@ -341,6 +342,7 @@ public class DMP implements DataEntity<DMP, UUID> {
this.publishedAt = publishedAt;
}
//TODO: Dois will no longer be fetched by hibernate but using the query builders eventually. Use builder where this is called.
public Set<EntityDoiEntity> getDois() {
return dois;
}