-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implemeted the one to many relationship for the metadata table using he
@ElementCollection annotation
- Loading branch information
1 parent
07a38d8
commit 51a95ac
Showing
12 changed files
with
146 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
src/main/java/uk/ac/ebi/eva/evaseqcol/entities/SeqColId.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/main/java/uk/ac/ebi/eva/evaseqcol/entities/SeqColMetadataEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package uk.ac.ebi.eva.evaseqcol.entities; | ||
|
||
import lombok.Data; | ||
import org.hibernate.annotations.CreationTimestamp; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Embeddable; | ||
import javax.persistence.EnumType; | ||
import javax.persistence.Enumerated; | ||
import javax.persistence.Temporal; | ||
import javax.persistence.TemporalType; | ||
import java.util.Date; | ||
|
||
@Data | ||
@Embeddable | ||
public class SeqColMetadataEntity { | ||
|
||
@Column(name = "source_id") | ||
private String sourceIdentifier; // Eg: INSDC Acession | ||
|
||
@Column(name = "source_url") | ||
private String sourceUrl; | ||
|
||
@Enumerated(EnumType.STRING) | ||
@Column(name = "naming_convention") | ||
private SeqColEntity.NamingConvention namingConvention; | ||
|
||
@Column(name = "timestamp", updatable = false, columnDefinition="TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | ||
@Temporal(TemporalType.TIMESTAMP) | ||
@CreationTimestamp | ||
private Date timestamp; | ||
|
||
public SeqColMetadataEntity setNamingConvention(SeqColEntity.NamingConvention namingConvention) { | ||
this.namingConvention = namingConvention; | ||
return this; | ||
} | ||
|
||
public SeqColMetadataEntity setSourceIdentifier(String sourceIdentifier) { | ||
this.sourceIdentifier = sourceIdentifier; | ||
return this; | ||
} | ||
|
||
public SeqColMetadataEntity setSourceUrl(String sourceUrl) { | ||
this.sourceUrl = sourceUrl; | ||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.