Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » EMFT Texo: Latest Build and Backward Compatibility
EMFT Texo: Latest Build and Backward Compatibility [message #879581] Thu, 31 May 2012 09:16 Go to next message
Martin Taal is currently offline Martin Taal
Messages: 5326
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 08:09 Go to previous messageGo to next message
Olaf Burdziakowski is currently offline 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 08:31]

Report message to a moderator

Re: EMFT Texo: Latest Build and Backward Compatibility [message #880129 is a reply to message #880094] Fri, 01 June 2012 09:39 Go to previous message
Martin Taal is currently offline Martin Taal
Messages: 5326
Registered: July 2009
Senior Member
Hi Olaf,
Actually the entity names are prefixed also with the name space prefix. But I guess you mean something else?
You mean that in the EPackage ORM annotation you can specify an entity name prefix (just as there is for the table)?

gr. Martin

On 06/01/2012 02:09 PM, Olaf Burdziakowski wrote:
> @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 two different prefixes in one of my packages instead of five. I
> see progress. But still I think you should allow adding prefixes to Entity (not only to Table name). Then it would be
> much easier to create common prefixes in each package. I would then select different prefix for each package and turn
> off enforceUniqueNames (false instead of true). This would be more user depended solution, not so sensitive on naming
> convention changes.


--

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
Previous Topic:[Edapt] handle user input during migration
Next Topic:Texo ModelPackage already registered
Goto Forum:
  


Current Time: Fri Aug 01 20:36:20 EDT 2014

Powered by FUDForum. Page generated in 0.01950 seconds