Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Riina Antikainen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f4ae1472
authored
Oct 07, 2017
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup unused and invalid functions
1 parent
60bbd297
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
36 deletions
code/moya-beans-client/ejbModule/fi/codecrew/moya/beans/EventBeanLocal.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/EventBean.java
code/moya-beans/ejbModule/fi/codecrew/moya/facade/EventFacade.java
code/moya-beans-client/ejbModule/fi/codecrew/moya/beans/EventBeanLocal.java
View file @
f4ae147
...
...
@@ -32,8 +32,6 @@ import fi.codecrew.moya.model.LanEventPropertyKey;
public
interface
EventBeanLocal
{
// static final String HTTP_URL_HOSTNAME = "HTTP_URL_HOSTNAME";
LanEvent
getEventByHostname
(
String
hostname
);
LanEvent
getCurrentEvent
();
LanEvent
mergeChanges
(
LanEvent
event
);
...
...
code/moya-beans/ejbModule/fi/codecrew/moya/beans/EventBean.java
View file @
f4ae147
...
...
@@ -88,18 +88,8 @@ public class EventBean implements EventBeanLocal {
@EJB
private
LoggingBeanLocal
logbean
;
@Override
public
LanEvent
getEventByHostname
(
String
hostname
)
{
LanEvent
ret
=
eventFacade
.
findByHostname
(
hostname
);
if
(
ret
==
null
)
{
ret
=
findOrCreateDefaultEvent
();
}
return
ret
;
}
public
LanEvent
findOrCreateDefaultEvent
()
{
LanEvent
ret
=
eventFacade
.
find
ByName
(
DEFAULT_EVENT_NAME
);
LanEvent
ret
=
eventFacade
.
find
(
1
);
if
(
ret
==
null
)
{
logger
.
info
(
"Default Event does not exist! creating new."
);
ret
=
new
LanEvent
();
...
...
code/moya-beans/ejbModule/fi/codecrew/moya/facade/EventFacade.java
View file @
f4ae147
...
...
@@ -40,29 +40,7 @@ public class EventFacade extends IntegerPkGenericFacade<LanEvent> {
super
(
LanEvent
.
class
);
}
public
LanEvent
findByHostname
(
String
hostname
)
{
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
LanEvent
>
cq
=
cb
.
createQuery
(
LanEvent
.
class
);
Root
<
LanEvent
>
root
=
cq
.
from
(
LanEvent
.
class
);
cq
.
where
(
cb
.
equal
(
root
.
get
(
LanEvent_
.
eventEnabled
),
true
));
// TypedQuery<LanEvent> q =
// em.createNamedQuery("LanEvent.findByReferer", LanEvent.class);
// q.setParameter("referer", hostname);
return
getSingleNullableResult
(
getEm
().
createQuery
(
cq
));
}
public
LanEvent
findByName
(
String
name
)
{
// TypedQuery<LanEvent> q = em.createNamedQuery("LanEvent.findByName",
// LanEvent.class);
// q.setParameter("name", name);
// return getSingleNullableResult(q);
return
this
.
find
(
1
);
}
public
String
flushCache
()
{
getEm
().
getEntityManagerFactory
().
getCache
().
evictAll
();
return
"Evicted all!"
;
...
...
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