Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
614fcfdb
Commit
614fcfdb
authored
Oct 15, 2018
by
Piotr Gawron
Browse files
hibernate upgraded
parent
2f156a29
Changes
19
Hide whitespace changes
Inline
Side-by-side
model/pom.xml
View file @
614fcfdb
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
lcsb.mapviewer
</groupId>
<artifactId>
parent
</artifactId>
<version>
1.0
</version>
</parent>
<artifactId>
model
</artifactId>
<name>
model MapViewer
</name>
<description>
Data model
</description>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
lcsb.mapviewer
</groupId>
<artifactId>
parent
</artifactId>
<version>
1.0
</version>
</parent>
<artifactId>
model
</artifactId>
<name>
model MapViewer
</name>
<description>
Data model
</description>
<dependencies>
<dependency>
<groupId>
lcsb.mapviewer
</groupId>
<artifactId>
commons
</artifactId>
<version>
1.0
</version>
</dependency>
<groupId>
lcsb.mapviewer
</groupId>
<artifactId>
commons
</artifactId>
<version>
1.0
</version>
</dependency>
<dependency>
<!-- Hibernate -->
<dependency>
<groupId>
org.hibernate
</groupId>
<artifactId>
hibernate-core
</artifactId>
<version>
${hibernate.version}
</version>
...
...
@@ -25,42 +28,64 @@
<artifactId>
xml-apis
</artifactId>
<groupId>
xml-apis
</groupId>
</exclusion>
<exclusion>
<groupId>
org.jboss.logging
</groupId>
<artifactId>
jboss-logging
</artifactId>
</exclusion>
<exclusion>
<groupId>
net.bytebuddy
</groupId>
<artifactId>
byte-buddy
</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Library excluded from above; it was in conflict with Xerces -->
<dependency>
</dependency>
<!-- https://mvnrepository.com/artifact/net.bytebuddy/byte-buddy -->
<dependency>
<groupId>
net.bytebuddy
</groupId>
<artifactId>
byte-buddy
</artifactId>
<version>
${byte-buddy.version}
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jboss.logging/jboss-logging -->
<dependency>
<groupId>
org.jboss.logging
</groupId>
<artifactId>
jboss-logging
</artifactId>
<version>
${jboss-logging.version}
</version>
</dependency>
<!-- Library excluded from above; it was in conflict with Xerces -->
<dependency>
<groupId>
xml-apis
</groupId>
<artifactId>
xml-apis
</artifactId>
<version>
${xml-apis.version}
</version>
</dependency>
<!-- Log4j - logging -->
<!-- Log4j - logging -->
<dependency>
<groupId>
log4j
</groupId>
<artifactId>
log4j
</artifactId>
<version>
${log4j.version}
</version>
</dependency>
<dependency>
<groupId>
org.reflections
</groupId>
<artifactId>
reflections
</artifactId>
<groupId>
org.reflections
</groupId>
<artifactId>
reflections
</artifactId>
<version>
${reflections.version}
</version>
<exclusions>
<exclusion>
<groupId>
org.javassist
</groupId>
<artifactId>
javassist
</artifactId>
<groupId>
org.javassist
</groupId>
<artifactId>
javassist
</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- mockito used for testing -->
<!-- mockito used for testing -->
<dependency>
<groupId>
org.mockito
</groupId>
<artifactId>
mockito-core
</artifactId>
<version>
${mockito.version}
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
model/src/main/java/lcsb/mapviewer/model/map/OverviewImage.java
View file @
614fcfdb
...
...
@@ -35,197 +35,197 @@ import lcsb.mapviewer.model.map.model.ModelData;
@Table
(
name
=
"overview_image_table"
)
public
class
OverviewImage
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
/**
* Unique database identifier.
*/
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"idDb"
,
unique
=
true
,
nullable
=
false
)
private
int
id
;
/**
* The image belongs to this {@link Project}. Links can point to any
* (sub)model
in this project.
*/
@ManyToOne
(
fetch
=
FetchType
.
LAZY
,
optional
=
false
)
private
Project
project
;
/**
* Name of the file in file system that reresent this overview image.
*/
private
String
filename
;
/**
* Width of the image.
*/
private
Integer
width
;
/**
* Height of the image.
*/
private
Integer
height
;
/**
* List of links that should redirect from this image. They can refer to
* another
{@link OverviewImage} or {@link ModelData Model}.
*/
@Cascade
({
CascadeType
.
ALL
})
@OneToMany
(
fetch
=
FetchType
.
EAGER
,
mappedBy
=
"overviewImage"
,
orphanRemoval
=
true
)
@OrderBy
(
"id"
)
private
List
<
OverviewLink
>
links
=
new
ArrayList
<>();
/**
* Default constructor.
*/
public
OverviewImage
()
{
}
/**
* Default constructor with original {@link OverviewImage} as a source of
*
data.
*
*
@param o
verviewImage
* original {@link OverviewImage}
*/
public
OverviewImage
(
OverviewImage
overviewImage
)
{
this
.
set
Id
(
overviewImage
.
get
Id
());
this
.
set
Project
(
overviewImage
.
get
Project
());
this
.
set
Filename
(
overviewImage
.
get
Filename
());
this
.
set
Width
(
overviewImage
.
get
Width
());
this
.
setHeight
(
overviewImage
.
get
Height
())
;
for
(
OverviewLink
ol
:
overviewImage
.
getLinks
())
{
this
.
addLink
(
ol
.
copy
());
}
}
/**
* @
return th
e filename
* @see #filename
*/
public
String
getF
ilename
()
{
return
filename
;
}
/**
*
@param
filename
* th
e filename
to set
* @see #filename
*/
public
void
setFilename
(
String
filename
)
{
this
.
filename
=
filename
;
}
/**
* @
return th
e width
* @see #width
*/
public
Integer
getWidth
()
{
return
width
;
}
/**
*
@param width
* th
e width
to set
* @see #width
*/
public
void
setWidth
(
Integer
width
)
{
this
.
width
=
width
;
}
/**
* @
return th
e height
* @see #height
*/
public
Integer
getH
eight
()
{
return
height
;
}
/**
*
@param heigh
t
* th
e height
to set
* @see #height
*/
public
void
setHeight
(
Integer
height
)
{
this
.
height
=
height
;
}
/**
* @
return th
e links
* @see #links
*/
public
List
<
OverviewLink
>
getLinks
()
{
return
links
;
}
/**
*
@param links
* th
e links
to set
* @see #links
*/
public
void
setLinks
(
List
<
OverviewLink
>
links
)
{
this
.
links
=
links
;
}
/**
* @
return th
e id
* @see #id
*/
public
int
getId
()
{
return
id
;
}
/**
*
@param id
* th
e id
to set
* @see #id
*/
public
void
setId
(
int
id
)
{
this
.
id
=
id
;
}
/**
* Adds {@link OverviewLink link } to {@link #links}.
*
*
@param oml
* object to add
*/
public
void
addLink
(
OverviewLink
oml
)
{
links
.
add
(
oml
);
oml
.
setOverviewImage
(
this
);
}
/**
* Creates a copy of the object.
*
* @return copy of the object
*/
public
OverviewImage
copy
(
)
{
if
(
this
.
getClass
()
==
OverviewImage
.
class
)
{
return
new
OverviewImage
(
this
);
}
else
{
throw
new
NotImplementedException
(
"Method copy() should be overriden in class "
+
this
.
getClass
());
}
}
/**
* @
return th
e project
* @see #project
*/
public
Project
getP
roject
()
{
return
project
;
}
/**
*
@param project
the project to set
* @see #project
*/
public
void
setProject
(
Project
project
)
{
this
.
project
=
project
;
}
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
/**
* Unique database identifier.
*/
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"idDb"
,
unique
=
true
,
nullable
=
false
)
private
int
id
;
/**
* The image belongs to this {@link Project}. Links can point to any
(sub)model
*
in this project.
*/
@ManyToOne
(
fetch
=
FetchType
.
LAZY
,
optional
=
false
)
private
Project
project
;
/**
* Name of the file in file system that re
p
resent this overview image.
*/
private
String
filename
;
/**
* Width of the image.
*/
private
Integer
width
;
/**
* Height of the image.
*/
private
Integer
height
;
/**
* List of links that should redirect from this image. They can refer to
another
*
{@link OverviewImage} or {@link ModelData Model}.
*/
@Cascade
({
CascadeType
.
ALL
})
@OneToMany
(
fetch
=
FetchType
.
EAGER
,
mappedBy
=
"overviewImage"
)
@OrderBy
(
"id"
)
private
List
<
OverviewLink
>
links
=
new
ArrayList
<>();
/**
* Default constructor.
*/
public
OverviewImage
()
{
}
/**
* Default constructor with original {@link OverviewImage} as a source of
data.
*
*
@param overviewImage
*
original {@link O
verviewImage
}
*/
public
OverviewImage
(
OverviewImage
overviewImage
)
{
this
.
setId
(
overviewImage
.
getId
());
this
.
set
Project
(
overviewImage
.
get
Project
());
this
.
set
Filename
(
overviewImage
.
get
Filename
());
this
.
set
Width
(
overviewImage
.
get
Width
());
this
.
set
Height
(
overviewImage
.
get
Height
());
for
(
OverviewLink
ol
:
overviewImage
.
get
Links
())
{
this
.
addLink
(
ol
.
copy
())
;
}
}
/**
* @return the filename
* @
se
e
#
filename
*/
public
String
getFilename
()
{
return
f
ilename
;
}
/**
* @param filename
*
the
filename
to set
* @se
e
#
filename
*/
public
void
setFilename
(
String
filename
)
{
this
.
filename
=
filename
;
}
/**
* @return the width
* @
se
e
#
width
*/
public
Integer
getWidth
()
{
return
width
;
}
/**
* @param width
*
the width to set
* @se
e
#
width
*/
public
void
setWidth
(
Integer
width
)
{
this
.
width
=
width
;
}
/**
* @return the height
* @
se
e
#
height
*/
public
Integer
getHeight
()
{
return
h
eight
;
}
/**
* @param height
*
the height to se
t
* @se
e
#
height
*/
public
void
setHeight
(
Integer
height
)
{
this
.
height
=
height
;
}
/**
* @return the links
* @
se
e
#
links
*/
public
List
<
OverviewLink
>
getLinks
()
{
return
links
;
}
/**
* @param links
*
the links to set
* @se
e
#
links
*/
public
void
setLinks
(
List
<
OverviewLink
>
links
)
{
this
.
links
=
links
;
}
/**
* @return the id
* @
se
e
#
id
*/
public
int
getId
()
{
return
id
;
}
/**
* @param id
*
the id to set
* @se
e
#
id
*/
public
void
setId
(
int
id
)
{
this
.
id
=
id
;
}
/**
* Adds {@link OverviewLink link } to {@link #links}.
*
*
@param oml
*
object to add
*/
public
void
addLink
(
OverviewLink
oml
)
{
links
.
add
(
oml
)
;
oml
.
setOverviewImage
(
this
);
}
/**
* Creates a copy of the object.
*
*
@return copy of the object
*/
public
OverviewImage
copy
()
{
if
(
this
.
getClass
()
==
OverviewImage
.
class
)
{
return
new
OverviewImage
(
this
);
}
else
{
throw
new
NotImplementedException
(
"Method copy() should be overriden in class "
+
this
.
getClass
());
}
}
/**
* @return the project
* @
se
e
#
project
*/
public
Project
getProject
()
{
return
p
roject
;
}
/**
* @param project
*
the project to set
* @see #project
*/
public
void
setProject
(
Project
project
)
{
this
.
project
=
project
;
}
}
model/src/main/java/lcsb/mapviewer/model/map/OverviewModelLink.java
View file @
614fcfdb
...
...
@@ -28,7 +28,7 @@ public class OverviewModelLink extends OverviewLink {
/**
* Model to which this links is going.
*/
@ManyToOne
(
fetch
=
FetchType
.
LAZY
,
optional
=
false
)
@ManyToOne
(
fetch
=
FetchType
.
LAZY
,
optional
=
false
)
private
ModelData
linkedModel
;
/**
...
...
model/src/main/java/lcsb/mapviewer/model/map/layout/graphics/Layer.java
View file @
614fcfdb
...
...
@@ -11,6 +11,8 @@ import javax.persistence.FetchType;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.JoinTable
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.OneToMany
;
import
javax.persistence.Table
;
...
...
@@ -35,367 +37,375 @@ import lcsb.mapviewer.model.map.model.ModelData;
@Table
(
name
=
"layer_table"
)
public
class
Layer
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
/**
* Default class logger.
*/
@SuppressWarnings
(
"unused"
)
private
static
Logger
logger
=
Logger
.
getLogger
(
Layer
.
class
);
/**
* Unique database identifier.
*/
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"idDb"
,
unique
=
true
,
nullable
=
false
)
private
int
id
;
/**
* Layer identifier (unique in single model).
*/
private
String
layerId
;
/**
* Layer name.
*/
private
String
name
;
/**
* Is the layer visible.
*/
private
boolean
visible
;
/**
* Is the layer locekd (can be edited).
*/
private
boolean
locked
;
/**
* List of text objects on the layer.
*/
@Cascade
({
CascadeType
.
ALL
})
@OneToMany
(
fetch
=
FetchType
.
EAGER
)
@IndexColumn
(
name
=
"idx"
)
private
List
<
LayerText
>
texts
=
new
ArrayList
<
LayerText
>();
/**
* List of line objects on the layer.
*/