Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PA165 Formula One Team
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Diana Gulčíková
PA165 Formula One Team
Commits
a27235a2
There was an error fetching the commit references. Please try again later.
Commit
a27235a2
authored
1 year ago
by
Tomáš Marek
Browse files
Options
Downloads
Patches
Plain Diff
Car Component queries
parent
b36b07ed
No related branches found
No related tags found
2 merge requests
!60
Docker
,
!48
14 component tests
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
component/src/main/java/cz/muni/pa165/component/data/repository/ComponentRepositoryInterface.java
+12
-0
12 additions, 0 deletions
...mponent/data/repository/ComponentRepositoryInterface.java
with
12 additions
and
0 deletions
component/src/main/java/cz/muni/pa165/component/data/repository/ComponentRepositoryInterface.java
+
12
−
0
View file @
a27235a2
...
@@ -2,11 +2,23 @@ package cz.muni.pa165.component.data.repository;
...
@@ -2,11 +2,23 @@ package cz.muni.pa165.component.data.repository;
import
cz.muni.pa165.component.data.model.CarComponent
;
import
cz.muni.pa165.component.data.model.CarComponent
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.Optional
;
/**
/**
* Repository of the car components.
* Repository of the car components.
*/
*/
@Repository
@Repository
public
interface
ComponentRepositoryInterface
extends
JpaRepository
<
CarComponent
,
Long
>
{
public
interface
ComponentRepositoryInterface
extends
JpaRepository
<
CarComponent
,
Long
>
{
@Query
(
"SELECT c FROM CarComponent c WHERE c.id = :id"
)
Optional
<
CarComponent
>
findById
(
@Param
(
"id"
)
Long
id
);
@Query
(
"SELECT c FROM CarComponent c"
)
List
<
CarComponent
>
findAll
();
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment