Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Linnea Samila
/
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 bf90958f
authored
Jan 29, 2015
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
All places might not have a map
1 parent
d39c210f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
code/moya-beans/ejbModule/fi/codecrew/moya/facade/PlaceFacade.java
code/moya-beans/ejbModule/fi/codecrew/moya/facade/PlaceFacade.java
View file @
bf90958
...
@@ -30,6 +30,7 @@ import javax.persistence.criteria.*;
...
@@ -30,6 +30,7 @@ import javax.persistence.criteria.*;
import
fi.codecrew.moya.beans.EventBean
;
import
fi.codecrew.moya.beans.EventBean
;
import
fi.codecrew.moya.model.*
;
import
fi.codecrew.moya.model.*
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -64,9 +65,11 @@ public class PlaceFacade extends IntegerPkGenericFacade<Place> {
...
@@ -64,9 +65,11 @@ public class PlaceFacade extends IntegerPkGenericFacade<Place> {
Root
<
Place
>
root
=
cq
.
from
(
Place
.
class
);
Root
<
Place
>
root
=
cq
.
from
(
Place
.
class
);
LanEvent
event
=
eventBean
.
getCurrentEvent
();
cq
.
where
(
cq
.
where
(
cb
.
equal
(
root
.
get
(
Place_
.
id
),
id
),
cb
.
equal
(
root
.
get
(
Place_
.
id
),
id
),
cb
.
equal
(
root
.
get
(
Place_
.
map
).
get
(
EventMap_
.
event
),
eventBean
.
getCurrentEvent
())
cb
.
or
(
cb
.
equal
(
root
.
get
(
Place_
.
map
).
get
(
EventMap_
.
event
),
event
),
cb
.
equal
(
root
.
get
(
Place_
.
product
).
get
(
Product_
.
event
),
event
))
);
);
return
super
.
getSingleNullableResult
(
getEm
().
createQuery
(
cq
));
return
super
.
getSingleNullableResult
(
getEm
().
createQuery
(
cq
));
}
}
...
@@ -306,18 +309,17 @@ public class PlaceFacade extends IntegerPkGenericFacade<Place> {
...
@@ -306,18 +309,17 @@ public class PlaceFacade extends IntegerPkGenericFacade<Place> {
subq
.
where
(
subq
.
where
(
placeJoin
.
get
(
Place_
.
id
).
isNotNull
(),
placeJoin
.
get
(
Place_
.
id
).
isNotNull
(),
cb
.
equal
(
placeJoin
.
get
(
Place_
.
map
).
get
(
EventMap_
.
event
),
eventBean
.
getCurrentEvent
())
cb
.
equal
(
placeJoin
.
get
(
Place_
.
map
).
get
(
EventMap_
.
event
),
eventBean
.
getCurrentEvent
())
);
);
ProductFlag
[]
flags
=
{
ProductFlag
.
CREATE_NEW_PLACE_WHEN_BOUGHT
};
ProductFlag
[]
flags
=
{
ProductFlag
.
CREATE_NEW_PLACE_WHEN_BOUGHT
};
cq
.
where
(
cq
.
where
(
cb
.
or
(
cb
.
or
(
root
.
get
(
Product_
.
id
).
in
(
subq
),
root
.
get
(
Product_
.
id
).
in
(
subq
),
root
.
get
(
Product_
.
productFlags
).
in
(
Arrays
.
asList
(
flags
))
root
.
get
(
Product_
.
productFlags
).
in
(
Arrays
.
asList
(
flags
))
),
),
cb
.
equal
(
root
.
get
(
Product_
.
event
),
eventBean
.
getCurrentEvent
())
cb
.
equal
(
root
.
get
(
Product_
.
event
),
eventBean
.
getCurrentEvent
())
);
);
cq
.
orderBy
(
cb
.
asc
(
root
.
get
(
Product_
.
name
)));
cq
.
orderBy
(
cb
.
asc
(
root
.
get
(
Product_
.
name
)));
...
...
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