Save Emf probleme with many reference to save [message #1804842] |
Tue, 02 April 2019 08:04 |
Quentin Vaccaro Messages: 1 Registered: April 2019 |
Junior Member |
|
|
Hi,
I use a Ecore model for generate domain code for my application.
In this model i have many Reference to a Object locate in a other file whom i don't know the path before i start the application.
This is a exemple of the persisting file,
I use save provide by emf on ecore
Resource resource = resourceSet.getResource(uri, true);
resource.getContents().clear();
resource.getContents().add(this.model);
final Map<Object, Object> saveOptions = new HashMap<Object, Object>();
try {
String timeColonPattern = "HH:mm:ss SSS";
DateTimeFormatter timeColonFormatter = DateTimeFormatter.ofPattern(timeColonPattern);
LocalTime localTime = LocalTime.now();
System.out.println("begin save :" + localTime.format(timeColonFormatter));
resource.save(saveOptions);
localTime = LocalTime.now();
System.out.println("end save :" + localTime.format(timeColonFormatter));
} catch (IOException e) {
e.printStackTrace();
}
When i have a little model , there no problem the saving is quick and work, but when i have to save a bigger model, as the example the file write 50 000 lines and it's take 10/15 min .
So i remove all the reference, i replace by a string and it's take less than 1 sec to save.
The problem is that i need this reference to the object, but i don't want to wait 15min all the time i want to save, same for the load.
How can i do that ? if is possible to not change the Ecore model ?
-
Attachment: exemple.png
(Size: 13.00KB, Downloaded 206 times)
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03305 seconds