fjtirado commented on code in PR #4000: URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4000#discussion_r2260749447
########## quarkus/addons/token-exchange/runtime/src/main/java/org/kie/kogito/addons/quarkus/token/exchange/persistence/model/TokenCacheRecord.java: ########## @@ -0,0 +1,131 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.kie.kogito.addons.quarkus.token.exchange.persistence.model; + +import java.time.Instant; +import java.util.Objects; + +/** + * Simple POJO representing a token cache record for JDBC persistence. + * Uses composite primary key of processInstanceId and authName. + * Follows the same pattern as other JDBC entities in the codebase. + */ +public class TokenCacheRecord { Review Comment: I think you should use Record for this one. Then, rather than use setters when mapping from result set, you use the constructor. And when creating it to be saved, you use the same constructor passing instant.now for the date parameters. Note that when reading from db, you save a couple of system calls to retrieve the current date, which is later overriden by the value in the db -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
