-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'querydsl-7.0' into maven-4
- Loading branch information
Showing
168 changed files
with
324 additions
and
12,076 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
12 changes: 11 additions & 1 deletion
12
...dsl-examples/querydsl-example-ksp-codegen/src/main/kotlin/com/querydsl/example/ksp/Cat.kt
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 |
---|---|---|
@@ -1,12 +1,22 @@ | ||
package com.querydsl.example.ksp | ||
|
||
import jakarta.persistence.Entity | ||
import jakarta.persistence.Enumerated | ||
import jakarta.persistence.EnumType | ||
import jakarta.persistence.Id | ||
import jakarta.persistence.ManyToOne | ||
|
||
@Entity | ||
class Cat( | ||
@Id | ||
val id: Int, | ||
val name: String, | ||
val isTailUpright: Boolean | ||
val isTailUpright: Boolean, | ||
val fluffiness: String? = null, | ||
|
||
@ManyToOne | ||
val owner: Person? = null, | ||
|
||
@Enumerated(EnumType.STRING) | ||
val catType: CatType? = CatType.HOUSE, | ||
) |
6 changes: 6 additions & 0 deletions
6
...examples/querydsl-example-ksp-codegen/src/main/kotlin/com/querydsl/example/ksp/CatType.kt
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,6 @@ | ||
package com.querydsl.example.ksp | ||
|
||
enum class CatType { | ||
HOUSE, | ||
MAINE_COON | ||
} |
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
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
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
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
58 changes: 58 additions & 0 deletions
58
querydsl-libraries/querydsl-core/src/main/java/com/querydsl/core/CloseableIterator.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,58 @@ | ||
package com.querydsl.core; | ||
|
||
import java.util.Iterator; | ||
import java.util.List; | ||
import java.util.Spliterator; | ||
import java.util.Spliterators; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.StreamSupport; | ||
|
||
public interface CloseableIterator<T> extends Iterator<T>, AutoCloseable { | ||
|
||
@Override | ||
void close(); | ||
|
||
public static <E> List<E> asList(CloseableIterator<E> iterator) { | ||
try (iterator) { | ||
return StreamSupport.stream( | ||
Spliterators.spliteratorUnknownSize(iterator, Spliterator.ORDERED), false) | ||
.collect(Collectors.toList()); | ||
} | ||
} | ||
|
||
public static <E> CloseableIterator<E> of(Iterator<E> iterator) { | ||
return of(iterator, () -> {}); | ||
} | ||
|
||
public static <E> CloseableIterator<E> of(CloseableIterator<E> iterator) { | ||
return of(iterator, iterator); | ||
} | ||
|
||
public static <E> CloseableIterator<E> of(Iterator<E> iterator, AutoCloseable closeable) { | ||
return new CloseableIterator<E>() { | ||
|
||
@Override | ||
public boolean hasNext() { | ||
return iterator.hasNext(); | ||
} | ||
|
||
@Override | ||
public E next() { | ||
return iterator.next(); | ||
} | ||
|
||
@Override | ||
public void close() { | ||
try { | ||
closeable.close(); | ||
} catch (Exception e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
}; | ||
} | ||
|
||
public static <E> List<E> asList(Iterator<E> iterator) { | ||
return asList(of(iterator)); | ||
} | ||
} |
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
18 changes: 18 additions & 0 deletions
18
querydsl-libraries/querydsl-core/src/main/java/com/querydsl/core/Pair.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,18 @@ | ||
package com.querydsl.core; | ||
|
||
public record Pair<F, S>(F first, S second) { | ||
|
||
@Deprecated | ||
public F getFirst() { | ||
return first(); | ||
} | ||
|
||
@Deprecated | ||
public S getSecond() { | ||
return second(); | ||
} | ||
|
||
public static <T, U> Pair<T, U> of(T key, U value) { | ||
return new Pair<>(key, value); | ||
} | ||
} |
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
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
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
Oops, something went wrong.