Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Creating a entity instance dynamically(Is that possible to create a instance of an Entity dinamically. I tried DynamicEntity but my mapping is not dynamic.)
Creating a entity instance dynamically [message #1681993] Tue, 17 March 2015 14:51
Tercio F. Gaudencio Filho is currently offline Tercio F. Gaudencio FilhoFriend
Messages: 4
Registered: March 2015
Junior Member
Hi!

In my application we work with handwritten Entities.

In some cases, we need to create a new instance of an entity and populate it, but dynamically.

We have the Class<SomeEntity> and need to populate it's properties with some values from a Map<String, Object>.

I tried to use DynamicEntity but when I retrieve the DynamicEntity a null is returned, as my mapping is not dynamic.

            final ClassDescriptor cd = Dao.session().getClassDescriptor(someEntityClass);
            final DynamicType type = DynamicHelper.getType(cd);
            // type == null


Is that possible to use DynamicEntity without a dynamic mapping? If not, how can I populate a new instance without using the setters in the class.

If I could use DynamicEntity it would be perfect.

Thanks.
Previous Topic:Unabled to set derived IDs
Next Topic:JAXB marshalling performance with nested classes
Goto Forum:
  


Current Time: Fri Apr 19 21:59:00 GMT 2024

Powered by FUDForum. Page generated in 0.02783 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top