EMFT Texo: Latest Build and Backward Compatibility [message #879581] |
Thu, 31 May 2012 13:16 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi,
I published a new build of Texo with many changes in the way the ORM generator generates db schema names. The goal is to
make the default behavior as safe as possible preventing name collisions.
***The big drawback/problem is that this latest build of Texo is probably not backward compatible with previously
generated mappings.***
I don't like this but as Texo is still incubation and as the changes are really needed to get to a much more stable and
robust mapping I felt that it was necessary for now. I will ofcourse prevent this as much as possible in the future.
To see any differences with the previous mapping, it is best to generate an orm.xml file using the previous version of
Texo and generate a new orm.xml with the latest version, and then compare the differences.
Summary of the changes:
>>> New/changed ORM Mapping Options <<<
Defaults of several options on the EPackageORMAnnotation have changed, new options have been added:
- addOrderColumnToListMappings: false
- enforceUniqueNames: true
- renameSQLReservedNames: true
- generateFullDbSchemaNames: true
With generateFullDbSchemaNames to false, Texo generated too many annotations, this has now been changed, so if
generateFullDbSchemaNames is false then only the minimal required annotations are generated, leaving the rest to the ORM
layer. However, if generateFullDbSchemaNames is true then the full set of annotations is generated to fully control the
db schema mapping.
The options can now also be set in the project properties:
- add the Texo nature to the project, right-click on the project, in the configure submenu, select 'add/remove Texo Nature'
- then go to the project properties, to the Texo section
- on the ORM Mapping tab you can set some ORM Mapping defaults
- these defaults can be overridden in the EPackage ORM annotation
See this wiki page:
http://wiki.eclipse.org/Texo/ORM_JPA_Options
>>> DB Schema Name Truncation <<<
The name truncation has changed also. Oracle has a maximum name length of 30 for which this is especially relevant. The
truncation will first remove all vowels starting from the back of the name (previously it started from the front), this
gives better name preservation for prefixes which are part of the name.
>>> Object Copier and Object Comparator <<<
New ObjectCopier and ObjectComparator classes/logic have been added to Texo.
>>> Model-driven/level testing: large increase in test coverage <<<
A more hidden development is that I have made several test cases on so-called model-level. These testcases are generic
and can be used for any model. Currently Texo has 52 test models with 3-4 generic testcases: JPA, JSON serialization,
Copy/Compare testcases.
The result is that the number of testcases has increased from about 130 to 375+. Giving much better testcoverage.
The upcoming weeks I will blog about these changes in some more detail.
--
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: EMFT Texo: Latest Build and Backward Compatibility [message #880094 is a reply to message #879581] |
Fri, 01 June 2012 12:09 |
Olaf Burdziakowski Messages: 46 Registered: April 2012 |
Member |
|
|
@Martin,
I observed how Texo generate automatic table names. My multi-package ecore file has several packages. I need unique Table and Entity names.
You updated automatic table name generation. Now I have same prefixes in one of my packages instead of five. Thank you.
Also generation different column references is working great:
@OneToMany(cascade = { CascadeType.ALL })
@JoinColumns({ @JoinColumn(name = "xcreconfig_ServiceTrTyp_mtchSt") })
private List<MatchSetType> matchSet = new ArrayList<MatchSetType>();
Now my annotations dramatically decreased.
Great job, thank you.
[Updated on: Fri, 01 June 2012 12:31] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02692 seconds