Create simple POJO classes (bytecode) at runtime (dynamically)

后端 未结 5 1198
遥遥无期
遥遥无期 2020-11-27 05:24

I\'ve the following scenario..

I am writing some tool that run user-entered query against the database and return the result..

The simplest way is to return

5条回答
  •  有刺的猬
    2020-11-27 06:28

    What would the caller do with a class that is generated on the fly and which his code therefore cannot know? The only way to access it would be via reflection. Returning a List or Map would actually be a much cleaner and more usable design.

提交回复
热议问题