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"; public static final String _isActive = "isActive";
@ManyToOne(fetch = FetchType.LAZY) @Column(name = "entity_id", columnDefinition = "BINARY(16)")
@JoinColumn(name = "entity_id", nullable = false)
private UUID entityId; private UUID entityId;
public static final String _entityId = "entityId"; public static final String _entityId = "entityId";

View File

@ -183,7 +183,8 @@ public class DMP implements DataEntity<DMP, UUID> {
@Convert(converter = DateToUTCConverter.class) @Convert(converter = DateToUTCConverter.class)
private Date publishedAt; private Date publishedAt;
@OneToMany(mappedBy = "entityId", fetch = FetchType.LAZY) // @OneToMany(mappedBy = "entityId", fetch = FetchType.LAZY)
@Transient
private Set<EntityDoiEntity> dois; private Set<EntityDoiEntity> dois;
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
@ -341,6 +342,7 @@ public class DMP implements DataEntity<DMP, UUID> {
this.publishedAt = publishedAt; 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() { public Set<EntityDoiEntity> getDois() {
return dois; return dois;
} }