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
public static void validateProxyability(PersistentClass persistentClass) { | |
Iterator properties = persistentClass.getPropertyIterator(); | |
Class clazz = persistentClass.getMappedClass(); | |
while(properties.hasNext()) { | |
Property property = (Property)properties.next(); | |
validateGetterSetterMethodProxyability("Getter", property.getGetter(clazz).getMethod()); | |
validateGetterSetterMethodProxyability("Setter", property.getSetter(clazz).getMethod()); | |
} |
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
import javax.persistence.* | |
@Entity | |
@Table(name = "member") | |
class Member( | |
@Id | |
@Column(name = "member_id") | |
var id: String, | |
var username: String, |
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
sourceSets { | |
main { | |
output.setResourcesDir(kotlin.classesDirectory) | |
} | |
} |
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
plugins { | |
kotlin("plugin.noarg") version "<Kotlin-version>" | |
} | |
// kotlin-jpa 플러그인을 사용할 경우 필요 없음 | |
allOpen { | |
annotation("javax.persistence.Entity") | |
annotation("javax.persistence.Embeddable") | |
annotation("javax.persistence.MappedSuperclass") | |
} |
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
plugins { | |
id("org.jetbrains.kotlin.plugin.allopen") version "<Kotlin-version>" | |
} | |
allOpen { | |
annotation("javax.persistence.Entity") | |
annotation("javax.persistence.Embeddable") | |
annotation("javax.persistence.MappedSuperclass") | |
} |
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
service Echo { | |
rpc OneToOne(Message) returns (Message) {} | |
rpc OneToMany(Message) returns (stream Message) {} | |
rpc ManyToOne(stream Message) returns (Message) {} | |
rpc ManyToMany(stream Message) returns (stream Message) {} | |
} | |
message Message { | |
int32 seq = 1; | |
string title = 2; |
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
@Get("/test") | |
public HttpResponse getTest(RequestContext ctx) { | |
CompletableFuture<HttpResponse> future = new CompletableFuture<>(); | |
WebClient client = WebClient.of("https://icanhazdadjoke.com"); | |
HttpResponse response = client.execute(RequestHeaders.of(HttpMethod.GET, "/", HttpHeaderNames.ACCEPT, HttpHeaderValues.APPLICATION_JSON)); | |
ContextAwareEventLoop eventLoop = ctx.eventLoop(); | |
response.aggregate().thenAcceptAsync(aggregatedRes -> { | |
AggregatedHttpResponse res = ... // do something with `aggregatedRes` | |
future.complete(res.toHttpResponse()); | |
}, eventLoop); |
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
default <T> CompletionStage<T> makeContextAware(CompletionStage<T> stage) { // A 인스턴스를 인자로 받음 | |
// 생략 | |
final CompletableFuture<T> future = JavaVersionSpecific.get().newContextAwareFuture(this); // B 인스턴스 생성 | |
stage.handle((result, cause) -> { // A와 B를 간접적으로 연결 | |
try (SafeCloseable ignored = push()) { | |
if (cause != null) { | |
future.completeExceptionally(cause); | |
} else { | |
future.complete(result); | |
} |
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
@Get("/test") | |
public HttpResponse getTest(RequestContext ctx) { | |
CompletableFuture<HttpResponse> future = new CompletableFuture<>(); | |
WebClient client = WebClient.of("https://icanhazdadjoke.com"); | |
HttpResponse response = client.execute(RequestHeaders.of(HttpMethod.GET, "/", HttpHeaderNames.ACCEPT, HttpHeaderValues.APPLICATION_JSON)); | |
response.aggregate().thenAccept(aggregatedRes -> { | |
try (SafeCloseable ignored = ctx.push()) { | |
AggregatedHttpResponse res = ... // do something with `aggregatedRes` | |
future.complete(res.toHttpResponse()); | |
} |
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
java.lang.IndexOutOfBoundsException: source had 4 elements, expected at least 6 | |
at reactor.core.publisher.MonoElementAt$ElementAtSubscriber.onComplete(MonoElementAt.java:137) | |
at reactor.core.publisher.FluxArray$ArraySubscription.fastPath(FluxArray.java:177) | |
at reactor.core.publisher.FluxArray$ArraySubscription.request(FluxArray.java:97) | |
at reactor.core.publisher.Operators$BaseFluxToMonoOperator.request(Operators.java:2041) | |
at reactor.core.publisher.MonoSubscribeOn$SubscribeOnSubscriber.trySchedule(MonoSubscribeOn.java:189) | |
at reactor.core.publisher.MonoSubscribeOn$SubscribeOnSubscriber.onSubscribe(MonoSubscribeOn.java:134) | |
at reactor.core.publisher.Operators$BaseFluxToMonoOperator.onSubscribe(Operators.java:2025) | |
at reactor.core.publisher.FluxArray.subscribe(FluxArray.java:53) | |
at reactor.core.publisher.FluxArray.subscribe(FluxArray.java:59) |
NewerOlder