Dynamic Hibernate Mapping Issue -
i have created application using struts2 , hibernate perform other operations. change requirement has come user should able control database schema ui means user should have ability add new columns on fly through user interface.
i not sure how can achieve updating database still leave entity class untouched.
to illustrate issue consider situation: have employee table 2 columns : name , roll number. create entity class
class student{ int id; string name; getters , setters }
using entity class can perform crud operations in database.
now do if need have new column "age" , and "age" should created inside database. , new column has added dynamically user interface.
is there way update entity on fly or there other way achieve it.
first of all, cannot on fly, need replace classes on application server.
you need add property entity, update daos , actions use new property.
the dynamic appearance of form field, has nothing hibernate nor struts, can use javascript that.
Comments
Post a Comment