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
b7d4b323
Commit
b7d4b323
authored
Dec 30, 2014
by
Matija Obreza
Browse files
Crop#cropRules not eagerly loaded
parent
ca541237
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/model/impl/Crop.java
View file @
b7d4b323
...
...
@@ -26,7 +26,6 @@ import java.util.Map;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.FetchType
;
import
javax.persistence.Lob
;
import
javax.persistence.OneToMany
;
import
javax.persistence.Table
;
...
...
@@ -72,7 +71,7 @@ public class Crop extends GlobalVersionedAuditedModel implements AclAwareModel {
* Rules
*/
@JsonIgnore
@OneToMany
(
mappedBy
=
"crop"
,
fetch
=
FetchType
.
EAGER
,
cascade
=
{},
orphanRemoval
=
true
)
@OneToMany
(
mappedBy
=
"crop"
,
cascade
=
{},
orphanRemoval
=
true
)
private
List
<
CropRule
>
cropRules
;
@Transient
...
...
src/main/java/org/genesys2/server/servlet/controller/CropController.java
View file @
b7d4b323
...
...
@@ -59,6 +59,7 @@ public class CropController extends BaseController {
throw
new
ResourceNotFoundException
();
}
model
.
addAttribute
(
"crop"
,
crop
);
model
.
addAttribute
(
"cropRules"
,
cropService
.
getCropRules
(
crop
));
model
.
addAttribute
(
"cropTaxonomies"
,
cropService
.
getCropTaxonomies
(
crop
,
new
PageRequest
(
0
,
20
,
new
Sort
(
"taxonomy.genus"
,
"taxonomy.species"
))));
return
"/crop/index"
;
...
...
src/main/webapp/WEB-INF/jsp/crop/index.jsp
View file @
b7d4b323
...
...
@@ -34,7 +34,7 @@
<h4><spring:message
code=
"crop.taxonomy-rules"
/></h4>
<ul
class=
"funny-list"
>
<c:forEach
items=
"
${
crop
.
cropRules
}
"
var=
"rule"
>
<c:forEach
items=
"
${
cropRules
}
"
var=
"rule"
>
<li
class=
"${rule.included ? '' : 'excluded'}"
/><b>
${rule.included ? '+' : '-'}
</b>
<c:out
value=
"
${
rule
.
genus
}
"
/>
<c:out
value=
"
${
rule
.
species
eq
null
?
'*'
:
rule
.
species
}
"
/></li>
</c:forEach>
</ul>
...
...
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