diff --git a/src/main/java/com/example/cosmos_serversb/models/Users.java b/src/main/java/com/example/cosmos_serversb/models/Users.java index bc79d3c..14733a7 100644 --- a/src/main/java/com/example/cosmos_serversb/models/Users.java +++ b/src/main/java/com/example/cosmos_serversb/models/Users.java @@ -53,6 +53,7 @@ Session session = SessionManager.getInstance().getSession(); createToken(uId); + Password password = new Password(pw, uId); User testUser = new User(name, uId, uri, iconImage);//名前、uId、ユーザーuri、パスワード、アイコンイメージを保存 session.save(testUser); return testUser; @@ -61,6 +62,7 @@ public static User setUser(String uId, String name, String pw, String iconImage) { Session session = SessionManager.getInstance().getSession(); List usersList = session.createQuery( "from User" ).list(); +// List passwordList = session.createQuery("from Password").list(); for ( User user : (List) usersList ) { if (user.getuId().equals(uId)) { user.setName(name); @@ -71,6 +73,15 @@ break; } } + /* + for ( Password password : (List) passwordList ) { + if (password.getPw().equals(pw)) { + password.setPw(newpw); + session.update(password); + break; + } + } + */ User findUser = (User) session.load(User.class, uId); return findUser; }