Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
reg-app
Regapp
Commits
43a89701
Commit
43a89701
authored
Aug 03, 2015
by
michael.simon
Browse files
add RoleGroupEntity
parent
e020ba38
Changes
1
Show whitespace changes
Inline
Side-by-side
bwreg-jpa/src/main/java/edu/kit/scc/webreg/entity/RoleGroupEntity.java
0 → 100644
View file @
43a89701
/*******************************************************************************
* Copyright (c) 2014 Michael Simon.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*
* Contributors:
* Michael Simon - initial
******************************************************************************/
package
edu.kit.scc.webreg.entity
;
import
java.io.Serializable
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.Table
;
@Entity
(
name
=
"RoleGroupEntity"
)
@Table
(
name
=
"role_group"
)
public
class
RoleGroupEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@ManyToOne
@JoinColumn
(
name
=
"role_id"
,
nullable
=
false
)
private
RoleEntity
role
;
@Id
@ManyToOne
@JoinColumn
(
name
=
"group_id"
,
nullable
=
false
)
private
GroupEntity
group
;
public
GroupEntity
getGroup
()
{
return
group
;
}
public
void
setGroup
(
GroupEntity
group
)
{
this
.
group
=
group
;
}
public
RoleEntity
getRole
()
{
return
role
;
}
public
void
setRole
(
RoleEntity
role
)
{
this
.
role
=
role
;
}
@Override
public
int
hashCode
()
{
final
int
prime
=
31
;
int
result
=
1
;
result
=
prime
*
result
+
((
group
==
null
)
?
0
:
group
.
hashCode
());
result
=
prime
*
result
+
((
role
==
null
)
?
0
:
role
.
hashCode
());
return
result
;
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
obj
)
return
true
;
if
(
obj
==
null
)
return
false
;
if
(
getClass
()
!=
obj
.
getClass
())
return
false
;
RoleGroupEntity
other
=
(
RoleGroupEntity
)
obj
;
if
(
group
==
null
)
{
if
(
other
.
group
!=
null
)
return
false
;
}
else
if
(!
group
.
equals
(
other
.
group
))
return
false
;
if
(
role
==
null
)
{
if
(
other
.
role
!=
null
)
return
false
;
}
else
if
(!
role
.
equals
(
other
.
role
))
return
false
;
return
true
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment