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()
精彩评论