Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Genesys Backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Genesys PGR
Genesys Backend
Commits
78fdb4b0
Commit
78fdb4b0
authored
Feb 26, 2014
by
Matija Obreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Taxonomy2 model
parent
0a7b4ecf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
131 additions
and
7 deletions
+131
-7
src/main/java/org/genesys2/server/model/genesys/Accession.java
...ain/java/org/genesys2/server/model/genesys/Accession.java
+31
-7
src/main/java/org/genesys2/server/model/genesys/Taxonomy2.java
...ain/java/org/genesys2/server/model/genesys/Taxonomy2.java
+100
-0
No files found.
src/main/java/org/genesys2/server/model/genesys/Accession.java
View file @
78fdb4b0
...
...
@@ -56,6 +56,10 @@ public class Accession extends VersionedAuditedModel {
@JoinColumn
(
name
=
"taxonomyId"
)
private
Taxonomy
taxonomy
;
@ManyToOne
(
cascade
=
{},
optional
=
false
)
@JoinColumn
(
name
=
"taxonomyId2"
)
private
Taxonomy2
taxonomy2
;
@Column
(
name
=
"acqSrc"
,
length
=
3
)
private
String
acquisitionSource
;
...
...
@@ -90,8 +94,11 @@ public class Accession extends VersionedAuditedModel {
@Column
(
name
=
"mlsStat"
)
private
Boolean
mlsStatus
;
@Column
(
name
=
"genus"
,
nullable
=
false
,
length
=
64
)
private
String
genus
;
@Column
(
name
=
"taxGenus"
,
nullable
=
true
)
private
long
taxGenus
;
@Column
(
name
=
"taxSpecies"
,
nullable
=
true
)
private
Long
taxSpecies
;
public
Accession
()
{
}
...
...
@@ -132,6 +139,10 @@ public class Accession extends VersionedAuditedModel {
return
this
.
taxonomy
;
}
public
Taxonomy2
getTaxonomy2
()
{
return
this
.
taxonomy2
;
}
public
void
setTaxonomy
(
final
Taxonomy
taxonomy
)
{
this
.
taxonomy
=
taxonomy
;
}
...
...
@@ -224,16 +235,29 @@ public class Accession extends VersionedAuditedModel {
this
.
mlsStatus
=
mlsStatus
;
}
public
String
getGenus
()
{
return
this
.
genus
;
public
long
getTaxGenus
()
{
return
taxGenus
;
}
public
void
setTaxGenus
(
long
taxGenus
)
{
this
.
taxGenus
=
taxGenus
;
}
public
Long
getTaxSpecies
()
{
return
taxSpecies
;
}
public
void
setTaxSpecies
(
Long
taxSpecies
)
{
this
.
taxSpecies
=
taxSpecies
;
}
public
void
set
Genus
(
final
String
genuss
)
{
this
.
genus
=
genuss
;
public
void
set
Taxonomy2
(
Taxonomy2
taxonomy2
)
{
this
.
taxonomy2
=
taxonomy2
;
}
@Override
public
String
toString
()
{
return
MessageFormat
.
format
(
"Accession id={0,number,#} A={3} inst={1} genus={2}"
,
id
,
instituteCode
,
g
enus
,
accessionName
);
return
MessageFormat
.
format
(
"Accession id={0,number,#} A={3} inst={1} genus={2}"
,
id
,
instituteCode
,
taxG
enus
,
accessionName
);
}
}
src/main/java/org/genesys2/server/model/genesys/Taxonomy2.java
0 → 100644
View file @
78fdb4b0
/**
* Copyright 2014 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
package
org.genesys2.server.model.genesys
;
import
java.text.MessageFormat
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
import
javax.persistence.UniqueConstraint
;
import
org.genesys2.server.model.GlobalVersionedAuditedModel
;
import
org.hibernate.search.annotations.Indexed
;
@Entity
// Add index on all fields
@Table
(
name
=
"taxonomy2"
,
uniqueConstraints
=
{
@UniqueConstraint
(
columnNames
=
{
"genus"
,
"species"
,
"spAuthor"
,
"subtaxa"
,
"subtAuthor"
})
})
@Indexed
public
class
Taxonomy2
extends
GlobalVersionedAuditedModel
{
private
static
final
long
serialVersionUID
=
8881324404490162933L
;
@Column
(
nullable
=
false
,
length
=
100
)
private
String
genus
;
@Column
(
nullable
=
false
,
length
=
100
)
private
String
species
;
@Column
(
nullable
=
true
,
length
=
100
)
private
String
spAuthor
;
@Column
(
nullable
=
true
,
length
=
100
)
private
String
subtaxa
;
@Column
(
nullable
=
true
,
length
=
100
)
private
String
subtAuthor
;
// @OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "taxonomy")
// private List<CropTaxonomy> cropTaxonomies;
public
String
getGenus
()
{
return
this
.
genus
;
}
public
void
setGenus
(
final
String
genus
)
{
this
.
genus
=
genus
;
}
public
String
getSpecies
()
{
return
this
.
species
;
}
public
void
setSpecies
(
final
String
species
)
{
this
.
species
=
species
;
}
public
String
getTaxonName
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
genus
).
append
(
" "
).
append
(
species
);
if
(
spAuthor
!=
null
)
sb
.
append
(
" "
).
append
(
spAuthor
);
if
(
subtaxa
!=
null
)
sb
.
append
(
" "
).
append
(
subtaxa
);
if
(
subtAuthor
!=
null
)
sb
.
append
(
" "
).
append
(
subtAuthor
);
return
sb
.
toString
();
}
// public List<CropTaxonomy> getCropTaxonomies() {
// return cropTaxonomies;
// }
//
// public void setCropTaxonomies(List<CropTaxonomy> cropTaxonomies) {
// this.cropTaxonomies = cropTaxonomies;
// }
@Override
public
String
toString
()
{
return
MessageFormat
.
format
(
"Tax id={0} taxonName="
,
id
,
getTaxonName
());
}
public
boolean
sameAs
(
Taxonomy2
taxonomy
)
{
return
taxonomy
==
null
?
false
:
taxonomy
.
getId
().
equals
(
id
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment