本文介绍了休眠的动态表创建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一名HIBERNATE BEGINNER,因为我需要用动态字段创建动态表,我选择使用hibernate。就我的理解而言,创建表需要一个具有类中定义的字段的类。我如何根据具有所需字段的表动态生成类?

我认为你一定要看看(实验性的,但非常稳定/成熟的)Hibernate动态映射:



您可以使用hibernate的所有功能(包括缓存等)以及HQL类对象语法的所有功能。


i AM A HIBERNATE BEGINNER ,Since i need to create dynamic tables with dynamic fields in them i chose to use hibernate . As far as my understanding , creating tables requires a class with the fields defined in the class . How do i generate the classes dynamically based on the table with the required fields ?

解决方案

I think that you should definitely have a look over the (experimental but quite stable/mature) Hibernate Dynamic mapping : http://docs.jboss.org/hibernate/core/3.5/reference/en/html/persistent-classes.html#persistent-classes-dynamicmodels

You will have the benefit of using all the features of hibernate (including caching, etc.) and all the power of HQL object-like syntax.

这篇关于休眠的动态表创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-27 05:16
查看更多