Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
spring-basic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Su Sandi Ko
spring-basic
Commits
a60dcd0d
Commit
a60dcd0d
authored
4 weeks ago
by
Su Sandi Ko
Browse files
Options
Downloads
Patches
Plain Diff
last commit after merge conflict
parent
91d55c4d
Branches
master
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/test/java/com/example/demo/repository/ItemRepositoryTest.java
+2
-54
2 additions, 54 deletions
.../java/com/example/demo/repository/ItemRepositoryTest.java
start-mysql.sh
+5
-0
5 additions, 0 deletions
start-mysql.sh
with
7 additions
and
54 deletions
src/test/java/com/example/demo/repository/ItemRepositoryTest.java
+
2
−
54
View file @
a60dcd0d
...
...
@@ -75,61 +75,9 @@ public class ItemRepositoryTest {
}
}
@Test
@DisplayName
(
"Querydsl 조회테스트 1"
)
public
void
queryDslTest
()
{
this
.
createItemList
();
JPAQueryFactory
queryFactory
=
new
JPAQueryFactory
(
em
);
QItem
qItem
=
QItem
.
item
;
JPAQuery
<
Item
>
query
=
queryFactory
.
selectFrom
(
qItem
)
.
where
(
qItem
.
itemSellStatus
.
eq
(
ItemSellStatus
.
SELL
))
.
where
(
qItem
.
itemDetail
.
like
(
"%"
+
"테스트 상품 상세설명"
+
"%"
))
.
orderBy
(
qItem
.
price
.
desc
());
List
<
Item
>
itemList
=
query
.
fetch
();
for
(
Item
item
:
itemList
)
{
System
.
out
.
println
(
item
.
toString
());
}
}
@Test
@DisplayName
(
"상품명 조회 테스트"
)
public
void
findByItemNmTest
()
{
this
.
createItemList
();
List
<
Item
>
itemList
=
itemRepository
.
findByItemNm
(
"테스트 상품 1"
);
for
(
Item
item
:
itemList
)
{
System
.
out
.
println
(
item
.
toString
());
}
}
@Test
@DisplayName
(
"상품명, 상품상세 설명 OR 테스트"
)
public
void
findByItemNmOrItemDetailTest
()
{
this
.
createItemList
();
List
<
Item
>
itemList
=
itemRepository
.
findByItemNmOrItemDetail
(
"테스트 상품 1"
,
"테스트 상품 상세 설명 5"
);
for
(
Item
item
:
itemList
)
{
System
.
out
.
println
(
item
.
toString
());
}
}
@Test
@DisplayName
(
"가격 LessThan 테스트"
)
public
void
findByPriceLessThanTest
()
{
this
.
createItemList
();
List
<
Item
>
itemList
=
itemRepository
.
findByPriceLessThan
(
10005
);
for
(
Item
item
:
itemList
)
{
System
.
out
.
println
(
item
.
toString
());
}
}
@Test
@DisplayName
(
"가격 내람차순 조회 테스트"
)
public
void
findByPriceLessThanOrderByPriceDesc
()
{
this
.
createItemList
();
List
<
Item
>
itemList
=
itemRepository
.
findByPriceLessThanOrderByPriceDesc
(
10005
);
for
(
Item
item
:
itemList
)
{
System
.
out
.
println
(
item
.
toString
());
}
}
/*
pg 26
...
...
This diff is collapsed.
Click to expand it.
start-mysql.sh
0 → 100644
+
5
−
0
View file @
a60dcd0d
docker login git.ajou.ac.kr:5050
image
=
git.ajou.ac.kr:5050/prcoding/containers/mysql:5.7
docker run
-d
-p
3306:3306
-v
~/.mysql:/var/lib/mysql
-e
MYSQL_ROOT_PASSWORD
=
web1
--name
mydb
$image
\ No newline at end of file
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