Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jh-boot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jan Hrabal
jh-boot
Commits
6fec5f23
Commit
6fec5f23
authored
Aug 29, 2019
by
Jan Hrabal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sql
parent
ac125b9b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
9 deletions
+18
-9
LegalDocument.java
src/main/java/com/jh/boot/document/LegalDocument.java
+15
-6
LegalDocumentRepository.java
...in/java/com/jh/boot/document/LegalDocumentRepository.java
+3
-3
No files found.
src/main/java/com/jh/boot/document/LegalDocument.java
View file @
6fec5f23
package
com
.
jh
.
boot
.
document
;
package
com
.
jh
.
boot
.
document
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
import
com.jh.boot.jpa.AbstractIdEntity
;
import
com.jh.boot.jpa.AbstractIdEntity
;
@Entity
@Table
(
name
=
"LEGAL_DOCUMENT"
)
public
class
LegalDocument
extends
AbstractIdEntity
{
public
class
LegalDocument
extends
AbstractIdEntity
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
@Column
(
name
=
"CODE"
)
private
String
code
;
private
String
code
;
@Column
(
name
=
"LOCALE"
)
private
String
locale
;
private
String
locale
;
private
String
text
;
@Column
(
name
=
"CONTENT"
)
private
String
content
;
public
LegalDocument
()
{
public
LegalDocument
()
{
}
}
...
@@ -19,7 +28,7 @@ public class LegalDocument extends AbstractIdEntity {
...
@@ -19,7 +28,7 @@ public class LegalDocument extends AbstractIdEntity {
super
();
super
();
this
.
code
=
code
;
this
.
code
=
code
;
this
.
locale
=
locale
;
this
.
locale
=
locale
;
this
.
tex
t
=
text
;
this
.
conten
t
=
text
;
}
}
public
String
getCode
()
{
public
String
getCode
()
{
...
@@ -38,12 +47,12 @@ public class LegalDocument extends AbstractIdEntity {
...
@@ -38,12 +47,12 @@ public class LegalDocument extends AbstractIdEntity {
this
.
locale
=
locale
;
this
.
locale
=
locale
;
}
}
public
String
get
Tex
t
()
{
public
String
get
Conten
t
()
{
return
tex
t
;
return
conten
t
;
}
}
public
void
set
Tex
t
(
String
text
)
{
public
void
set
Conten
t
(
String
text
)
{
this
.
tex
t
=
text
;
this
.
conten
t
=
text
;
}
}
}
}
src/main/java/com/jh/boot/document/LegalDocumentRepository.java
View file @
6fec5f23
...
@@ -21,8 +21,8 @@ public class LegalDocumentRepository extends AbstractHibernateRepository {
...
@@ -21,8 +21,8 @@ public class LegalDocumentRepository extends AbstractHibernateRepository {
locale
=
locale
.
replace
(
"-"
,
"_"
);
locale
=
locale
.
replace
(
"-"
,
"_"
);
Query
q
=
entityManager
.
createQuery
(
"select ld from LegalDocument ld where lower(ld.code) = :code and lower(ld.locale) = :locale"
);
Query
q
=
entityManager
.
createQuery
(
"select ld from LegalDocument ld where lower(ld.code) = :code and lower(ld.locale) = :locale"
);
q
.
setParameter
(
"code"
,
locale
.
trim
()
.
toLowerCase
());
q
.
setParameter
(
"code"
,
code
.
toLowerCase
());
q
.
setParameter
(
"locale"
,
locale
.
t
rim
().
t
oLowerCase
());
q
.
setParameter
(
"locale"
,
locale
.
toLowerCase
());
LegalDocument
ld
=
singleResult
(
q
);
LegalDocument
ld
=
singleResult
(
q
);
if
(
ld
==
null
)
{
if
(
ld
==
null
)
{
...
@@ -33,7 +33,7 @@ public class LegalDocumentRepository extends AbstractHibernateRepository {
...
@@ -33,7 +33,7 @@ public class LegalDocumentRepository extends AbstractHibernateRepository {
}
}
}
}
return
null
;
return
ld
;
}
}
...
...
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