Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Texo] ModelDataGenerator
[Texo] ModelDataGenerator [message #1597433] Mon, 02 February 2015 09:35 Go to next message
Bastian Wagenfeld is currently offline Bastian WagenfeldFriend
Messages: 183
Registered: January 2013
Senior Member
Hi Martin,

I just tried to write a test with a large amount of data. Therefore I tried to generate model data. I used your code in the Texo wiki:

final ModelDataGenerator modelDataGenerator = new ModelDataGenerator();
modelDataGenerator.setStartEClasses(eClasses);
modelDataGenerator.setMaxDepth(maxDepth);
modelDataGenerator.setCollectionSize(collectionSize);
modelDataGenerator.setDataSize(dataSize);
modelDataGenerator.setMaxObjects(maxObjects);
modelDataGenerator.setEPackages(ePackages);
modelDataGenerator.generateTestData();
System.err.println("Generated " + modelDataGenerator.getTotalObjectCount() + " objects ");
List<EObject> result = modelDataGenerator.getResult();


Then I wanted to save the data directly through an EntityManager. This won't work, since the all returned data are of type DynamicEObject. My assumption was the returned objects would be Texo model objects.
Converting those DynamicEObjects to the EMF model works. So persisting the EMF objects within a 2- or 3-Tier-Architecture would work. But in this test environment this would be a little detour.

Is the DynamicEObject usage mandatory or is just something configured incorrectly?

Best regards
Bastian
Re: [Texo] ModelDataGenerator [message #1602024 is a reply to message #1597433] Thu, 05 February 2015 09:16 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Bastian,
There is a EMF --> Texo converter: EMFModelConverter, so you can call this after the data generation.

gr. Martin

On 02-02-15 10:35, Bastian Wagenfeld wrote:
> Hi Martin,
>
> I just tried to write a test with a large amount of data. Therefore I tried to generate model data. I used your code in
> the Texo wiki:
> final ModelDataGenerator modelDataGenerator = new ModelDataGenerator();
> modelDataGenerator.setStartEClasses(eClasses);
> modelDataGenerator.setMaxDepth(maxDepth);
> modelDataGenerator.setCollectionSize(collectionSize);
> modelDataGenerator.setDataSize(dataSize);
> modelDataGenerator.setMaxObjects(maxObjects);
> modelDataGenerator.setEPackages(ePackages);
> modelDataGenerator.generateTestData();
> System.err.println("Generated " + modelDataGenerator.getTotalObjectCount() + " objects ");
> List<EObject> result = modelDataGenerator.getResult();
>
> Then I wanted to save the data directly through an EntityManager. This won't work, since the all returned data are of
> type DynamicEObject. My assumption was the returned objects would be Texo model objects. Converting those
> DynamicEObjects to the EMF model works. So persisting the EMF objects within a 2- or 3-Tier-Architecture would work. But
> in this test environment this would be a little detour.
>
> Is the DynamicEObject usage mandatory or is just something configured incorrectly?
>
> Best regards
> Bastian


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] ModelDataGenerator [message #1603575 is a reply to message #1602024] Fri, 06 February 2015 08:50 Go to previous message
Bastian Wagenfeld is currently offline Bastian WagenfeldFriend
Messages: 183
Registered: January 2013
Senior Member
Hi Martin,

thanks, that was it. I just expected the getResult() method to return the Texo objects directly and not a DynamicEObject.

Best regards
Bastian
Previous Topic:[Edapt] Model includes references
Next Topic:[EMFForms] template styling capability
Goto Forum:
  


Current Time: Sat Apr 04 13:34:41 GMT 2020

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

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

Back to the top