Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
f3d71771
Commit
f3d71771
authored
Jul 14, 2018
by
Matija Obreza
Browse files
FIX: mysql key limit, must trim collName
parent
b6ddc4ed
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/model/genesys/AccessionCollect.java
View file @
f3d71771
...
...
@@ -68,7 +68,7 @@ public class AccessionCollect extends BasicModel implements AccessionRelated, Se
@CollectionTable
(
name
=
"accession_collect_code"
,
joinColumns
=
@JoinColumn
(
name
=
"collectId"
,
referencedColumnName
=
"id"
))
private
Set
<
String
>
collCode
;
@Column
(
name
=
"collName"
,
nullable
=
false
,
length
=
25
8
)
@Column
(
name
=
"collName"
,
nullable
=
false
,
length
=
25
0
)
@ElementCollection
(
fetch
=
FetchType
.
LAZY
)
@CollectionTable
(
name
=
"accession_collect_name"
,
joinColumns
=
@JoinColumn
(
name
=
"collectId"
,
referencedColumnName
=
"id"
))
private
Set
<
String
>
collName
;
...
...
@@ -93,13 +93,13 @@ public class AccessionCollect extends BasicModel implements AccessionRelated, Se
// remove blank collCode
if
(
collCode
!=
null
&&
!
collCode
.
isEmpty
())
{
Set
<
String
>
notBlank
=
collCode
.
stream
().
filter
(
str
->
StringUtils
.
isNotBlank
(
str
)
).
collect
(
Collectors
.
toSet
());
Set
<
String
>
notBlank
=
collCode
.
stream
().
map
(
str
->
StringUtils
.
trimToNull
(
str
)).
filter
(
str
->
str
!=
null
).
collect
(
Collectors
.
toSet
());
collCode
.
clear
();
collCode
.
addAll
(
notBlank
);
}
// remove blank collName
if
(
collName
!=
null
&&
!
collName
.
isEmpty
())
{
Set
<
String
>
notBlank
=
collName
.
stream
().
filter
(
str
->
StringUtils
.
isNotBlank
(
str
)).
collect
(
Collectors
.
toSet
());
Set
<
String
>
notBlank
=
collName
.
stream
().
map
(
str
->
StringUtils
.
trimToNull
(
str
)).
filter
(
str
->
str
!=
null
).
map
(
str
->
StringUtils
.
abbreviate
(
str
,
"..."
,
250
)).
collect
(
Collectors
.
toSet
());
collName
.
clear
();
collName
.
addAll
(
notBlank
);
}
...
...
src/main/resources/liquibase/liquibase-changeLog.yml
View file @
f3d71771
...
...
@@ -1405,7 +1405,7 @@ databaseChangeLog:
constraints
:
nullable
:
false
name
:
collName
type
:
VARCHAR(25
8
)
type
:
VARCHAR(25
0
)
tableName
:
accession_collect_name
-
addPrimaryKey
:
columnNames
:
collectId, collName
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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