开发者

hibernate mapping of 2 column table

I have a table with 2 varchar columns key,value used to store config for an application. (key column is aso the primary key) Is there any other way to use it in hibernate than native sql queries? Can one do any object mapping that would expose this v开发者_高级运维alues?

thanks


Sure. Create class ConfigurationItem with two properties: String key, String value. Map them to the appropriate fields with the key mapped as the id column. Then to load them just session.createQuery("from ConfigurationItem").list()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜