Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7e92ccc7
authored
Apr 03, 2018
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert MenuItemFacade changes, accidentally merged from angular branch
1 parent
2dd354b0
Pipeline
#58
failed
in 0 seconds
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
code/moya-beans/ejbModule/fi/codecrew/moya/facade/MenuitemFacade.java
code/moya-beans/ejbModule/fi/codecrew/moya/facade/MenuitemFacade.java
View file @
7e92ccc
...
@@ -41,9 +41,28 @@ public class MenuitemFacade extends IntegerPkGenericFacade<Menuitem> {
...
@@ -41,9 +41,28 @@ public class MenuitemFacade extends IntegerPkGenericFacade<Menuitem> {
super
(
Menuitem
.
class
);
super
(
Menuitem
.
class
);
}
}
public
Menuitem
findOrCreate
(
String
url
)
{
public
Menuitem
findOrCreate
(
String
url
)
{
return
findOrCreate
(
url
);
if
(
url
==
null
||
url
.
isEmpty
())
{
return
null
;
}
try
{
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
Menuitem
>
cq
=
cb
.
createQuery
(
Menuitem
.
class
);
Root
<
Menuitem
>
root
=
cq
.
from
(
Menuitem
.
class
);
cq
.
where
(
cb
.
equal
(
root
.
get
(
Menuitem_
.
url
),
url
));
Menuitem
ret
=
super
.
getSingleNullableResult
(
getEm
()
.
createQuery
(
cq
));
if
(
ret
==
null
)
{
ret
=
new
Menuitem
();
ret
.
setUrl
(
url
);
create
(
ret
);
}
return
ret
;
}
catch
(
Exception
e
)
{
logger
.
warn
(
"Exception menussa"
+
url
,
e
);
}
return
null
;
}
}
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment