Retrieve a row from DB as a Map in Hibernate

后端 未结 3 558
野的像风
野的像风 2021-01-13 05:33

Table Players:

ID | name  | email | age | ...
1  | \'bob\' | null  | 23  | ...

This table is where instances of class Pl

3条回答
  •  旧时难觅i
    2021-01-13 06:32

    You can use BeanUtils and do something like this:

    User user = (User) session.get(User.class, userID);
    Map map = BeanUtils.describe(user);
    

提交回复
热议问题