In Hibernate, You can use dynamic-map or dom4j entity mode of Hibernate (also dynamic component can be usefull)
If you use your custom DAO framework you can do it by java reflection ( CGLIB is better about performance )
But how dynamic member variables can be usefull for your real project ? it means use maps instead of dynamic member variables