A robust starter web application to ease Java webapp development.

Home | Tutorials | Demos | Issues

dynamic fields implementation

View: New views
2 Messages — Rating Filter:   Alert me  

dynamic fields implementation

by Rajeev Goel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi All,

I would like to implement dynamic field functionality for my hibernate + spring based application.

- user should be able to add additional fields (not defined during initial system design)
- fields can be added without restarting server
- preferably fields could be of specific data type (String, boolean, integer, etc). Else they could all be string and front-end layer can format it.

Additional information:
- using Hibernate 3.2 with annotations (JPA).
- dynamicComponent configuration is available only with hbm.xml (old way). We would preferably like to continue with JPA.
- our domain is quite rich, approach shouldn't be too narrow.

If you know of any concrete approaches for the same, please let me know.

thanks in advance,
have a great day !

Rajeev

Re: dynamic fields implementation

by Oscar Alvarez-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

HI.

You can design an extra entity that holds new fields... and references your initial system design entity...
An example of that may be looks like:

ExtraData(id, idReferencedEntity, nameReferencedEntity, fieldType, fieldName, fieldValue)

And adicionally you may be need some extra java classes to translate it to the right java data type...

HTH
Oscar

2009/6/22 Rajeev Goel <db.rajeev@...>
hi All,

I would like to implement dynamic field functionality for my hibernate + spring based application.

- user should be able to add additional fields (not defined during initial system design)
- fields can be added without restarting server
- preferably fields could be of specific data type (String, boolean, integer, etc). Else they could all be string and front-end layer can format it.

Additional information:
- using Hibernate 3.2 with annotations (JPA).
- dynamicComponent configuration is available only with hbm.xml (old way). We would preferably like to continue with JPA.
- our domain is quite rich, approach shouldn't be too narrow.

If you know of any concrete approaches for the same, please let me know.

thanks in advance,
have a great day !

Rajeev



--
Atentamente
Óscar Álvarez Vielma
(09) 8416 4052