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 88d3085b
authored
May 10, 2018
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into feature/folderStructure
2 parents
617ab770
c74dae17
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
32 deletions
code/moya-angular/package.json
code/moya-angular/pom.xml
code/moya-beans/ejbModule/fi/codecrew/moya/facade/MenuitemFacade.java
code/moya-angular/package.json
View file @
88d3085
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
"aot"
:
"ng build --aot"
,
"aot"
:
"ng build --aot"
,
"test"
:
"ng test"
,
"test"
:
"ng test"
,
"lint"
:
"ng lint"
,
"lint"
:
"ng lint"
,
"test-n-build"
:
"ng lint && ng test && ng build"
,
"e2e"
:
"ng e2e"
,
"e2e"
:
"ng e2e"
,
"version"
:
"ng version"
"version"
:
"ng version"
},
},
...
...
code/moya-angular/pom.xml
View file @
88d3085
...
@@ -27,36 +27,33 @@
...
@@ -27,36 +27,33 @@
<executions>
<executions>
<execution>
<execution>
<!-- optional: you don't really need execution ids,
<!-- optional: you don't really need execution ids,
but it looks nice in your build log. -->
but it looks nice in your build log. -->
<id>
install node and npm
</id>
<id>
install node and npm
</id>
<goals>
<goals>
<goal>
install-node-and-npm
</goal>
<goal>
install-node-and-npm
</goal>
</goals>
</goals>
<configuration>
<configuration>
<nodeVersion>
${js.node.version}
</nodeVersion>
<nodeVersion>
${js.node.version}
</nodeVersion>
<npmVersion>
${js.npm.version}
</npmVersion>
<npmVersion>
${js.npm.version}
</npmVersion>
</configuration>
</configuration>
</execution>
</execution>
<execution>
<execution>
<id>
npm install
</id>
<id>
npm install
</id>
<goals>
<goals>
<goal>
npm
</goal>
<goal>
npm
</goal>
</goals>
</goals>
</execution>
</execution>
<execution>
<id>
npm run build
</id>
<execution>
<goals>
<id>
npm run build
</id>
<goal>
npm
</goal>
<goals>
</goals>
<goal>
npm
</goal>
<phase>
generate-resources
</phase>
</goals>
<configuration>
<phase>
generate-resources
</phase>
<arguments>
run test-n-build
</arguments>
<configuration>
</configuration>
<arguments>
run build
</arguments>
</execution>
</configuration>
</execution>
</executions>
</executions>
</plugin>
</plugin>
</plugins>
</plugins>
...
...
code/moya-beans/ejbModule/fi/codecrew/moya/facade/MenuitemFacade.java
View file @
88d3085
...
@@ -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