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 dd068d5b
authored
Jan 29, 2015
by
Juho Salli
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'placefetch' into 'master'
Placefetch fix See merge request
!241
2 parents
1c9ac393
c8fb5f0a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
21 deletions
code/moya-beans/ejbModule/fi/codecrew/moya/beans/PlaceBean.java
code/moya-beans/ejbModule/fi/codecrew/moya/facade/PlaceFacade.java
code/moya-web/pom.xml
code/moya-beans/ejbModule/fi/codecrew/moya/beans/PlaceBean.java
View file @
dd068d5
...
...
@@ -584,11 +584,26 @@ public class PlaceBean implements PlaceBeanLocal {
@Override
@RolesAllowed
(
MapPermission
.
S_VIEW
)
public
Place
find
(
int
placeId
)
{
return
placeFacade
.
find
(
placeId
);
Place
ret
=
placeFacade
.
find
(
placeId
);
// Check that place belongs to this event before returning it.
if
(
ret
.
getProduct
()
!=
null
)
{
if
(
eventBean
.
getCurrentEvent
().
equals
(
ret
.
getProduct
().
getEvent
()))
{
return
ret
;
}
return
null
;
}
if
(
ret
.
getMap
()
!=
null
)
{
if
(
eventBean
.
getCurrentEvent
().
equals
(
ret
.
getMap
().
getEvent
()))
{
return
ret
;
}
}
return
null
;
}
@Override
@RolesAllowed
(
MapPermission
.
S_
BUY_PLACE
S
)
@RolesAllowed
(
MapPermission
.
S_
MANAGE_OTHER
S
)
public
Place
unbuyPlace
(
Place
place
)
{
place
=
placeFacade
.
reload
(
place
);
if
(
place
.
getGroup
()
!=
null
)
{
...
...
@@ -806,7 +821,7 @@ public class PlaceBean implements PlaceBeanLocal {
row
=
placeSlotFacade
.
reload
(
row
);
if
(
row
.
getPlace
()
==
null
&&
row
.
getUsed
()
==
null
)
{
row
.
setUsed
(
new
Date
());
}
else
{
}
else
{
return
false
;
}
return
true
;
...
...
@@ -817,7 +832,7 @@ public class PlaceBean implements PlaceBeanLocal {
row
=
placeSlotFacade
.
reload
(
row
);
if
(
row
.
getPlace
()
==
null
&&
row
.
getUsed
()
!=
null
)
{
row
.
setUsed
(
null
);
}
else
{
}
else
{
return
false
;
}
return
true
;
...
...
code/moya-beans/ejbModule/fi/codecrew/moya/facade/PlaceFacade.java
View file @
dd068d5
...
...
@@ -58,22 +58,6 @@ public class PlaceFacade extends IntegerPkGenericFacade<Place> {
super
(
Place
.
class
);
}
@Override
public
Place
find
(
Integer
id
)
{
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
Place
>
cq
=
cb
.
createQuery
(
Place
.
class
);
Root
<
Place
>
root
=
cq
.
from
(
Place
.
class
);
LanEvent
event
=
eventBean
.
getCurrentEvent
();
cq
.
where
(
cb
.
equal
(
root
.
get
(
Place_
.
id
),
id
),
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
));
}
public
void
timeoutPlaces
()
{
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
Place
>
cq
=
cb
.
createQuery
(
Place
.
class
);
...
...
code/moya-web/pom.xml
View file @
dd068d5
...
...
@@ -45,7 +45,7 @@
<dependency>
<groupId>
fi.codecrew.moya
</groupId>
<artifactId>
moya-restpojo
</artifactId>
<version>
1.0.
5
</version>
<version>
1.0.
6
</version>
</dependency>
</dependencies>
...
...
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