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 b844d99..fe7b620 100644 --- a/src/main/java/com/example/cosmos_serversb/models/Users.java +++ b/src/main/java/com/example/cosmos_serversb/models/Users.java @@ -35,11 +35,13 @@ //Tokenを作成しuIdと関連付けしDBに保存し作成したTokenを返す String token = UUID.randomUUID().toString(); Token testToken =new Token(token, uId); + + /*TODO:Session managerを作成しセッションの二重作成をしない Session session = sessionFactory.openSession(); session.beginTransaction(); session.save(testToken); session.getTransaction().commit(); - session.close(); + session.close();*/ return testToken; } @@ -55,7 +57,7 @@ Session session = sessionFactory.openSession(); session.beginTransaction(); -// createToken(uId); + createToken(uId); User testUser = new User(name, uId, uri, iconImage);//名前、uId、ユーザーuri、パスワード、アイコンイメージを保存 session.save(testUser); //出力 @@ -103,7 +105,6 @@ User findUser = (User) session.load(User.class, uId); ObjectMapper mapper = new ObjectMapper(); // User testUser = mapper.addMixIn(findUser,findUser.removeuIdAnduri); - mapper.addMixIn(User.class, User.removeuIdAnduri.class); return null; // System.out.println( "name: " + user.getName() + "iconUri : " + user.getIconUri()); }else{