Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jan Smejkal
Pa165 Secret Archive
Commits
eccbcdd9
Commit
eccbcdd9
authored
Mar 26, 2022
by
Smejky338
Browse files
Remove extend from ReportDao and add missing visibility to methods
parent
2ee1311e
Pipeline
#122632
waiting for manual action with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/cz/fi/muni/pa165/seminar4/group7/secretservice/dao/ReportDao.java
View file @
eccbcdd9
package
cz.fi.muni.pa165.seminar4.group7.secretservice.dao
;
package
java.
cz.fi.muni.pa165.seminar4.group7.secretservice.dao
;
import
cz.fi.muni.pa165.seminar4.group7.secretservice.entity.Report
;
import
org.springframework.data.repository.CrudRepository
;
import
java.util.List
;
/**
* @author Jan Smejkal
*/
public
interface
ReportDao
extends
CrudRepository
<
Report
,
Long
>
{
public
interface
ReportDao
{
void
create
(
Report
report
);
List
<
Report
>
findAll
();
...
...
src/main/java/cz/fi/muni/pa165/seminar4/group7/secretservice/dao/ReportDaoImpl.java
View file @
eccbcdd9
package
cz.fi.muni.pa165.seminar4.group7.secretservice.dao
;
package
java.
cz.fi.muni.pa165.seminar4.group7.secretservice.dao
;
import
cz.fi.muni.pa165.seminar4.group7.secretservice.entity.Report
;
import
org.springframework.data.repository.CrudRepository
;
...
...
@@ -18,28 +18,27 @@ public class ReportDaoImpl implements ReportDao {
@PersistenceContext
private
EntityManager
em
;
public
Agen
tDaoImpl
(
EntityManager
em
)
{
public
Repor
tDaoImpl
(
EntityManager
em
)
{
this
.
em
=
em
;
}
@Override
void
create
(
Report
report
)
{
public
void
create
(
Report
report
)
{
em
.
persist
(
report
);
}
@Override
List
<
Report
>
findAll
()
{
public
List
<
Report
>
findAll
()
{
return
em
.
createQuery
(
"select r from Report r"
,
Report
.
class
).
getResultList
();
}
@Override
Report
findById
(
long
id
)
{
return
em
.
createQuery
(
"select p from Product p where name = :name"
,
Product
.
class
)
.
setParameter
(
"name"
,
name
)
.
getResultList
();
public
Report
findById
(
long
id
)
{
return
em
.
find
(
Report
.
class
,
id
);
}
@Override
void
remove
(
Report
report
)
{
public
void
remove
(
Report
report
)
{
em
.
remove
(
report
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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