简体   繁体   English

更改对象列表中的字段名称

[英]change field names in a list of Objects

I use hql to query from database. 我用hql从数据库中查询。 first query returns a list of objects like this 第一个查询返回这样的对象列表

see image: 看图像: 图片1

as you can see, the field names of retrieved objects are obvious (ID, TIMESTAMP, ...) 如您所见,检索到的对象的字段名称是显而易见的(ID,TIMESTAMP,...)

but in the second query, what I get, is this: 但在第二个查询中,我得到的是:

see image: 看图像: 图2

and I need to change field names ([0] to ID , 1 to TITLE, ...) any solutions?! 我需要更改字段名称([0]到ID, 1到TITLE,...)任何解决方案?!

  1. Create a simple data holding object that contains your needed data. 创建一个包含所需数据的简单数据保存对象。
  2. Fill your data into such an object 将数据填入此类对象
  3. Add this object to a new list/array 将此对象添加到新列表/数组
  4. View the debugger on this list again 再次查看此列表中的调试器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM