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 5be2ac47
authored
Apr 01, 2013
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
There, I fixeds it
1 parent
49762fda
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
11 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/CheckoutFiBean.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/PlaceBean.java
code/MoyaDatabase/src/fi/codecrew/moya/model/GroupMembership.java
code/MoyaDatabase/src/fi/codecrew/moya/model/PlaceGroup.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/CheckoutFiBean.java
View file @
5be2ac4
package
fi
.
codecrew
.
moya
.
beans
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.StringWriter
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
...
...
@@ -91,10 +92,25 @@ public class CheckoutFiBean implements CheckoutFiBeanLocal {
||
merchantPassword
==
null
||
merchantPassword
.
isEmpty
());
}
public
static
void
main
(
String
[]
asd
)
public
static
void
main
(
String
[]
asd
)
throws
ParserConfigurationException
,
SAXException
,
IOException
{
System
.
out
.
println
(
Calendar
.
getInstance
().
getTimeInMillis
());
System
.
out
.
println
(
Calendar
.
getInstance
().
getTimeInMillis
()
/
1000
);
// DocumentBuilderFactory dbFactory =
// DocumentBuilderFactory.newInstance();
// DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
// Document doc = dBuilder.parse(xmlstr);
// // DOMParser parser = new DOMParser();
// // Document doc = parser.getDocument();
// // parser.parse(new InputSource(new StringReader(xmlReturn)));
// Element root = doc.getDocumentElement();
// root.normalize();
// // NodeList rootChildren = root.getChildNodes();
// // for (int i = 0; i < rootChildren.getLength(); ++i)
// // {
// // logger.info("Rootchild {}", rootChildren.item(i).getNodeName());
// // }
//
// Node payments = root.getElementsByTagName("banks").item(0);
}
private
static
final
String
DATEFORMAT
=
"yyyyMMdd"
;
...
...
@@ -226,7 +242,10 @@ public class CheckoutFiBean implements CheckoutFiBeanLocal {
// parser.parse(new InputSource(new StringReader(xmlReturn)));
DocumentBuilderFactory
dbFactory
=
DocumentBuilderFactory
.
newInstance
();
DocumentBuilder
dBuilder
=
dbFactory
.
newDocumentBuilder
();
Document
doc
=
dBuilder
.
parse
(
xmlReturn
);
InputStream
xmlstr
=
IOUtils
.
toInputStream
(
xmlReturn
);
Document
doc
=
dBuilder
.
parse
(
xmlstr
);
// Document doc = parser.getDocument();
Element
root
=
doc
.
getDocumentElement
();
root
.
normalize
();
...
...
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/PlaceBean.java
View file @
5be2ac4
...
...
@@ -483,7 +483,6 @@ public class PlaceBean implements PlaceBeanLocal {
@RolesAllowed
(
MapPermission
.
S_BUY_PLACES
)
public
Place
unbuyPlace
(
Place
place
)
{
place
=
placeFacade
.
reload
(
place
);
if
(
place
.
getGroup
()
!=
null
)
{
place
.
getGroup
().
getPlaces
().
remove
(
place
);
}
...
...
code/MoyaDatabase/src/fi/codecrew/moya/model/GroupMembership.java
View file @
5be2ac4
...
...
@@ -4,10 +4,9 @@
*/
package
fi
.
codecrew
.
moya
.
model
;
import
static
javax
.
persistence
.
CascadeType
.
ALL
;
import
java.util.Calendar
;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.JoinColumn
;
...
...
@@ -50,7 +49,7 @@ public class GroupMembership extends GenericEntity {
@Column
(
name
=
"invite_name"
)
private
String
inviteName
;
@ManyToOne
(
optional
=
false
,
cascade
=
ALL
)
@ManyToOne
(
optional
=
false
,
cascade
=
CascadeType
.
PERSIST
)
@JoinColumn
(
name
=
GROUP_ID
,
referencedColumnName
=
"id"
,
nullable
=
false
)
private
PlaceGroup
placeGroup
;
...
...
code/MoyaDatabase/src/fi/codecrew/moya/model/PlaceGroup.java
View file @
5be2ac4
...
...
@@ -64,15 +64,14 @@ public class PlaceGroup extends GenericEntity {
@ManyToOne
private
EventUser
creator
;
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"placeGroup"
)
@OneToMany
(
cascade
=
{
CascadeType
.
PERSIST
}
,
mappedBy
=
"placeGroup"
)
private
List
<
GroupMembership
>
members
=
new
ArrayList
<
GroupMembership
>();
@OneToMany
(
mappedBy
=
"group"
)
@OrderBy
(
"name"
)
private
List
<
Place
>
places
;
public
PlaceGroup
(
LanEvent
event
,
Calendar
groupCreated
,
Calendar
groupEdited
,
boolean
groupActive
)
{
public
PlaceGroup
(
LanEvent
event
,
Calendar
groupCreated
,
Calendar
groupEdited
,
boolean
groupActive
)
{
this
.
event
=
event
;
this
.
created
=
groupCreated
;
this
.
edited
=
groupEdited
;
...
...
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