-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47d4119
commit 60dffb1
Showing
11 changed files
with
362 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
package pj.circles.domain; | ||
|
||
import static com.querydsl.core.types.PathMetadataFactory.*; | ||
|
||
import com.querydsl.core.types.dsl.*; | ||
|
||
import com.querydsl.core.types.PathMetadata; | ||
import javax.annotation.Generated; | ||
import com.querydsl.core.types.Path; | ||
import com.querydsl.core.types.dsl.PathInits; | ||
|
||
|
||
/** | ||
* QCircle is a Querydsl query type for Circle | ||
*/ | ||
@Generated("com.querydsl.codegen.EntitySerializer") | ||
public class QCircle extends EntityPathBase<Circle> { | ||
|
||
private static final long serialVersionUID = 2090783579L; | ||
|
||
private static final PathInits INITS = PathInits.DIRECT2; | ||
|
||
public static final QCircle circle = new QCircle("circle"); | ||
|
||
public final StringPath address = createString("address"); | ||
|
||
public final StringPath cafeLink = createString("cafeLink"); | ||
|
||
public final EnumPath<CircleCategory> circleCategory = createEnum("circleCategory", CircleCategory.class); | ||
|
||
public final EnumPath<CircleDivision> circleDivision = createEnum("circleDivision", CircleDivision.class); | ||
|
||
public final NumberPath<Long> id = createNumber("id", Long.class); | ||
|
||
public final StringPath information = createString("information"); | ||
|
||
public final StringPath introduce = createString("introduce"); | ||
|
||
public final StringPath link = createString("link"); | ||
|
||
public final QMember member; | ||
|
||
public final ListPath<MemberLikeCircle, QMemberLikeCircle> memberLikeCircles = this.<MemberLikeCircle, QMemberLikeCircle>createList("memberLikeCircles", MemberLikeCircle.class, QMemberLikeCircle.class, PathInits.DIRECT2); | ||
|
||
public final StringPath name = createString("name"); | ||
|
||
public final StringPath oneLineIntroduce = createString("oneLineIntroduce"); | ||
|
||
public final StringPath openKakaoLink = createString("openKakaoLink"); | ||
|
||
public final StringPath phoneNumber = createString("phoneNumber"); | ||
|
||
public final ListPath<Photo, QPhoto> photos = this.<Photo, QPhoto>createList("photos", Photo.class, QPhoto.class, PathInits.DIRECT2); | ||
|
||
public final BooleanPath recruit = createBoolean("recruit"); | ||
|
||
public final DateTimePath<java.time.LocalDateTime> recruitEndDate = createDateTime("recruitEndDate", java.time.LocalDateTime.class); | ||
|
||
public final DateTimePath<java.time.LocalDateTime> recruitStartDate = createDateTime("recruitStartDate", java.time.LocalDateTime.class); | ||
|
||
public QCircle(String variable) { | ||
this(Circle.class, forVariable(variable), INITS); | ||
} | ||
|
||
public QCircle(Path<? extends Circle> path) { | ||
this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS)); | ||
} | ||
|
||
public QCircle(PathMetadata metadata) { | ||
this(metadata, PathInits.getFor(metadata, INITS)); | ||
} | ||
|
||
public QCircle(PathMetadata metadata, PathInits inits) { | ||
this(Circle.class, metadata, inits); | ||
} | ||
|
||
public QCircle(Class<? extends Circle> type, PathMetadata metadata, PathInits inits) { | ||
super(type, metadata, inits); | ||
this.member = inits.isInitialized("member") ? new QMember(forProperty("member"), inits.get("member")) : null; | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package pj.circles.domain; | ||
|
||
import static com.querydsl.core.types.PathMetadataFactory.*; | ||
|
||
import com.querydsl.core.types.dsl.*; | ||
|
||
import com.querydsl.core.types.PathMetadata; | ||
import javax.annotation.Generated; | ||
import com.querydsl.core.types.Path; | ||
|
||
|
||
/** | ||
* QEmail is a Querydsl query type for Email | ||
*/ | ||
@Generated("com.querydsl.codegen.EntitySerializer") | ||
public class QEmail extends EntityPathBase<Email> { | ||
|
||
private static final long serialVersionUID = 1870510001L; | ||
|
||
public static final QEmail email1 = new QEmail("email1"); | ||
|
||
public final StringPath code = createString("code"); | ||
|
||
public final StringPath email = createString("email"); | ||
|
||
public final NumberPath<Long> id = createNumber("id", Long.class); | ||
|
||
public final BooleanPath isCheck = createBoolean("isCheck"); | ||
|
||
public final BooleanPath isJoin = createBoolean("isJoin"); | ||
|
||
public QEmail(String variable) { | ||
super(Email.class, forVariable(variable)); | ||
} | ||
|
||
public QEmail(Path<? extends Email> path) { | ||
super(path.getType(), path.getMetadata()); | ||
} | ||
|
||
public QEmail(PathMetadata metadata) { | ||
super(Email.class, metadata); | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package pj.circles.domain; | ||
|
||
import static com.querydsl.core.types.PathMetadataFactory.*; | ||
|
||
import com.querydsl.core.types.dsl.*; | ||
|
||
import com.querydsl.core.types.PathMetadata; | ||
import javax.annotation.Generated; | ||
import com.querydsl.core.types.Path; | ||
import com.querydsl.core.types.dsl.PathInits; | ||
|
||
|
||
/** | ||
* QMember is a Querydsl query type for Member | ||
*/ | ||
@Generated("com.querydsl.codegen.EntitySerializer") | ||
public class QMember extends EntityPathBase<Member> { | ||
|
||
private static final long serialVersionUID = -1921736411L; | ||
|
||
private static final PathInits INITS = PathInits.DIRECT2; | ||
|
||
public static final QMember member = new QMember("member1"); | ||
|
||
public final QCircle circle; | ||
|
||
public final StringPath email = createString("email"); | ||
|
||
public final NumberPath<Long> id = createNumber("id", Long.class); | ||
|
||
public final ListPath<MemberLikeCircle, QMemberLikeCircle> memberLikeCircles = this.<MemberLikeCircle, QMemberLikeCircle>createList("memberLikeCircles", MemberLikeCircle.class, QMemberLikeCircle.class, PathInits.DIRECT2); | ||
|
||
public final StringPath nickName = createString("nickName"); | ||
|
||
public final StringPath password = createString("password"); | ||
|
||
public final SetPath<String, StringPath> roles = this.<String, StringPath>createSet("roles", String.class, StringPath.class, PathInits.DIRECT2); | ||
|
||
public QMember(String variable) { | ||
this(Member.class, forVariable(variable), INITS); | ||
} | ||
|
||
public QMember(Path<? extends Member> path) { | ||
this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS)); | ||
} | ||
|
||
public QMember(PathMetadata metadata) { | ||
this(metadata, PathInits.getFor(metadata, INITS)); | ||
} | ||
|
||
public QMember(PathMetadata metadata, PathInits inits) { | ||
this(Member.class, metadata, inits); | ||
} | ||
|
||
public QMember(Class<? extends Member> type, PathMetadata metadata, PathInits inits) { | ||
super(type, metadata, inits); | ||
this.circle = inits.isInitialized("circle") ? new QCircle(forProperty("circle"), inits.get("circle")) : null; | ||
} | ||
|
||
} | ||
|
54 changes: 54 additions & 0 deletions
54
src/main/generated/pj/circles/domain/QMemberLikeCircle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package pj.circles.domain; | ||
|
||
import static com.querydsl.core.types.PathMetadataFactory.*; | ||
|
||
import com.querydsl.core.types.dsl.*; | ||
|
||
import com.querydsl.core.types.PathMetadata; | ||
import javax.annotation.Generated; | ||
import com.querydsl.core.types.Path; | ||
import com.querydsl.core.types.dsl.PathInits; | ||
|
||
|
||
/** | ||
* QMemberLikeCircle is a Querydsl query type for MemberLikeCircle | ||
*/ | ||
@Generated("com.querydsl.codegen.EntitySerializer") | ||
public class QMemberLikeCircle extends EntityPathBase<MemberLikeCircle> { | ||
|
||
private static final long serialVersionUID = -1106174388L; | ||
|
||
private static final PathInits INITS = PathInits.DIRECT2; | ||
|
||
public static final QMemberLikeCircle memberLikeCircle = new QMemberLikeCircle("memberLikeCircle"); | ||
|
||
public final QCircle circle; | ||
|
||
public final NumberPath<Long> id = createNumber("id", Long.class); | ||
|
||
public final QMember member; | ||
|
||
public QMemberLikeCircle(String variable) { | ||
this(MemberLikeCircle.class, forVariable(variable), INITS); | ||
} | ||
|
||
public QMemberLikeCircle(Path<? extends MemberLikeCircle> path) { | ||
this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS)); | ||
} | ||
|
||
public QMemberLikeCircle(PathMetadata metadata) { | ||
this(metadata, PathInits.getFor(metadata, INITS)); | ||
} | ||
|
||
public QMemberLikeCircle(PathMetadata metadata, PathInits inits) { | ||
this(MemberLikeCircle.class, metadata, inits); | ||
} | ||
|
||
public QMemberLikeCircle(Class<? extends MemberLikeCircle> type, PathMetadata metadata, PathInits inits) { | ||
super(type, metadata, inits); | ||
this.circle = inits.isInitialized("circle") ? new QCircle(forProperty("circle"), inits.get("circle")) : null; | ||
this.member = inits.isInitialized("member") ? new QMember(forProperty("member"), inits.get("member")) : null; | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package pj.circles.domain; | ||
|
||
import static com.querydsl.core.types.PathMetadataFactory.*; | ||
|
||
import com.querydsl.core.types.dsl.*; | ||
|
||
import com.querydsl.core.types.PathMetadata; | ||
import javax.annotation.Generated; | ||
import com.querydsl.core.types.Path; | ||
import com.querydsl.core.types.dsl.PathInits; | ||
|
||
|
||
/** | ||
* QPhoto is a Querydsl query type for Photo | ||
*/ | ||
@Generated("com.querydsl.codegen.EntitySerializer") | ||
public class QPhoto extends EntityPathBase<Photo> { | ||
|
||
private static final long serialVersionUID = 1880533575L; | ||
|
||
private static final PathInits INITS = PathInits.DIRECT2; | ||
|
||
public static final QPhoto photo = new QPhoto("photo"); | ||
|
||
public final QCircle circle; | ||
|
||
public final NumberPath<Long> id = createNumber("id", Long.class); | ||
|
||
public final EnumPath<PhotoType> photoType = createEnum("photoType", PhotoType.class); | ||
|
||
public final StringPath storeFileName = createString("storeFileName"); | ||
|
||
public final StringPath uploadFileName = createString("uploadFileName"); | ||
|
||
public QPhoto(String variable) { | ||
this(Photo.class, forVariable(variable), INITS); | ||
} | ||
|
||
public QPhoto(Path<? extends Photo> path) { | ||
this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS)); | ||
} | ||
|
||
public QPhoto(PathMetadata metadata) { | ||
this(metadata, PathInits.getFor(metadata, INITS)); | ||
} | ||
|
||
public QPhoto(PathMetadata metadata, PathInits inits) { | ||
this(Photo.class, metadata, inits); | ||
} | ||
|
||
public QPhoto(Class<? extends Photo> type, PathMetadata metadata, PathInits inits) { | ||
super(type, metadata, inits); | ||
this.circle = inits.isInitialized("circle") ? new QCircle(forProperty("circle"), inits.get("circle")) : null; | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package pj.circles.config; | ||
|
||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import javax.persistence.EntityManager; | ||
import javax.persistence.PersistenceContext; | ||
|
||
@Configuration | ||
public class QueryDslConfig { | ||
@PersistenceContext | ||
public EntityManager em; | ||
|
||
@Bean | ||
public JPAQueryFactory jpaQueryFactory(){ | ||
return new JPAQueryFactory(em); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/main/java/pj/circles/repository/CircleRepositoryCustom.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package pj.circles.repository; | ||
|
||
import pj.circles.domain.Circle; | ||
|
||
import java.util.List; | ||
|
||
public interface CircleRepositoryCustom { | ||
List<Circle> getList(int page); | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/pj/circles/repository/CircleRepositoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package pj.circles.repository; | ||
|
||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import lombok.RequiredArgsConstructor; | ||
import pj.circles.domain.Circle; | ||
import pj.circles.domain.QCircle; | ||
|
||
import java.util.List; | ||
|
||
@RequiredArgsConstructor | ||
public class CircleRepositoryImpl implements CircleRepositoryCustom{ | ||
|
||
private final JPAQueryFactory jpaQueryFactory; | ||
|
||
|
||
@Override | ||
public List<Circle> getList(int page) { | ||
return jpaQueryFactory.selectFrom(QCircle.circle) | ||
.limit(5) | ||
.offset((long) page*5) | ||
.fetch(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters