Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
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 d5470a06
authored
Nov 17, 2012
by
Tuukka Kivilahti, TKffTK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InventoryEvent added, production -> development
1 parent
0314626d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
2 deletions
code/LanBortalDatabase/src/fi/insomnia/bortal/model/InventoryEvent.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Product.java
code/LanBortalWeb/WebContent/WEB-INF/web.xml
code/LanBortalDatabase/src/fi/insomnia/bortal/model/InventoryEvent.java
0 → 100644
View file @
d5470a0
package
fi
.
insomnia
.
bortal
.
model
;
import
java.util.Date
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.Table
;
import
javax.persistence.Temporal
;
import
javax.persistence.TemporalType
;
import
org.eclipse.persistence.annotations.OptimisticLocking
;
import
org.eclipse.persistence.annotations.OptimisticLockingType
;
@Entity
@Table
(
name
=
"inventory_event"
)
@OptimisticLocking
(
type
=
OptimisticLockingType
.
CHANGED_COLUMNS
)
public
class
InventoryEvent
extends
GenericEntity
{
private
static
final
long
serialVersionUID
=
1L
;
@Column
(
name
=
"created"
,
nullable
=
false
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Date
created
=
new
Date
();
@JoinColumn
(
name
=
"user_id"
)
private
User
user
;
public
Product
getProduct
()
{
return
product
;
}
public
void
setProduct
(
Product
product
)
{
this
.
product
=
product
;
}
public
String
getInfo
()
{
return
info
;
}
public
void
setInfo
(
String
info
)
{
this
.
info
=
info
;
}
public
int
getCount
()
{
return
count
;
}
public
void
setCount
(
int
count
)
{
this
.
count
=
count
;
}
@JoinColumn
(
name
=
"product_id"
)
private
Product
product
;
@Column
(
name
=
"info"
,
nullable
=
true
)
private
String
info
;
@Column
(
name
=
"count"
,
nullable
=
false
)
private
int
count
;
public
User
getUser
()
{
return
user
;
}
public
void
setUser
(
User
user
)
{
this
.
user
=
user
;
}
public
Date
getCreated
()
{
return
created
;
}
public
void
setCreated
(
Date
created
)
{
this
.
created
=
created
;
}
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Product.java
View file @
d5470a0
...
...
@@ -91,6 +91,9 @@ public class Product extends GenericEntity {
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"product"
)
private
List
<
AccountEvent
>
accountEvents
;
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"product"
)
private
List
<
InventoryEvent
>
inventoryEvents
;
@ManyToMany
(
cascade
=
CascadeType
.
ALL
)
@JoinTable
(
name
=
"product_discounts"
,
...
...
@@ -304,4 +307,12 @@ public class Product extends GenericEntity {
this
.
buyInPrice
=
buyInPrice
;
}
public
List
<
InventoryEvent
>
getInventoryEvents
()
{
return
inventoryEvents
;
}
public
void
setInventoryEvents
(
List
<
InventoryEvent
>
inventoryEvents
)
{
this
.
inventoryEvents
=
inventoryEvents
;
}
}
code/LanBortalWeb/WebContent/WEB-INF/web.xml
View file @
d5470a0
...
...
@@ -9,8 +9,8 @@
</session-config>
<context-param>
<param-name>
javax.faces.PROJECT_STAGE
</param-name>
<
param-value>
Production
</param-value
>
<
!-- <param-value>Development</param-value> --
>
<
!-- param-value>Production</param-value --
>
<
param-value>
Development
</param-value
>
</context-param>
<context-param>
...
...
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