Copilot commented on code in PR #12632:
URL: https://github.com/apache/cloudstack/pull/12632#discussion_r2794529117


##########
engine/schema/src/main/java/com/cloud/user/dao/AccountDaoImpl.java:
##########
@@ -42,7 +42,7 @@
 
 @Component
 public class AccountDaoImpl extends GenericDaoBase<AccountVO, Long> implements 
AccountDao {
-    private static final String FIND_USER_ACCOUNT_BY_API_KEY = "SELECT u.id, 
u.username, u.account_id, u.secret_key, u.state, u.api_key_access, "
+    private static final String FIND_USER_ACCOUNT_BY_API_KEY = "SELECT u.id, 
u.uuid u.username, u.account_id, u.secret_key, u.state, u.api_key_access, "

Review Comment:
   The SQL SELECT list is missing a comma between `u.uuid` and `u.username` 
(`u.uuid u.username`). In MySQL this is parsed as `u.uuid` aliased to 
`u.username`, which drops the real username column and shifts/breaks the 
ResultSet column indexes used below. Add the comma (and consider explicit 
aliases) so the selected columns match the `rs.get*` positions.
   ```suggestion
       private static final String FIND_USER_ACCOUNT_BY_API_KEY = "SELECT u.id, 
u.uuid, u.username, u.account_id, u.secret_key, u.state, u.api_key_access, "
   ```



##########
api/src/main/java/com/cloud/user/User.java:
##########
@@ -35,6 +35,8 @@ public enum Source {
 
     public String getUuid();
 
+    public void setUuid(String uuid);
+

Review Comment:
   Adding `setUuid` to the public `com.cloud.user.User` interface is an API 
surface change and allows mutating what is typically an immutable identifier. 
To avoid impacting downstream implementers/binary compatibility, prefer keeping 
`User` read-only and either: (1) make the local variable a `UserVO` (or cast) 
when setting the UUID, or (2) introduce a `UserVO(long id, String uuid)` 
constructor/factory used by the DAO.
   ```suggestion
   
   ```



-- 
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]

Reply via email to