The earlier suggested patch (swapping MappedSuperClass and Entity annotations 
in Entity and EntityImpl) causes the timetracker sample project tests to fail, 
because the OneToMany relationship references the Entity rather than the 
EntityImpl class. The tests don't even run crud operations, they simply load 
the persistence.xml and validate against the Entity mappings. We need to figure 
out EXACTLY what needs to change in the Entity and EntityImpl and GlobalMacros 
templates for OneToMany and ManyToMany, for this to work. I tried simply 
swapping EntityImpl for Entity and updating persistence.xml but that didn't 
work. The first step in doing that is to make the modifications to the 
generated code in order to get everything working, and then modify the 
associated template (named in the /* comments */ at the top of the generated 
code file). A starting point would be to check out the andromda project from 
sourceforge SVN and build the project locally.

There are some other updates needed in the hibernate cartridge, i.e. the sql 
generated from the mappings does not have the correct naming conventions for 
some PK/FK columns. Also we should generate CRUD tests like in the EJB3 
cartridge. You can see these results when running the sample timetracker build, 
checked out from SVN. And... the spring cartridge uses the old 
HibernateTemplate and Dao pattern which is a no-longer-recommended design 
pattern, in favor of the standard hibernate SessionFactory and @Repository 
annotations. See 
http://docs.spring.io/spring/docs/3.0.x/spring-framework-reference/html/orm.html#orm-hibernate-straight.

The temporal type annotation was carried over from the EJB3 cartridge 
persistence updates, I don't think it is used in the hibernate cartridge but 
that wouldn't be hard to implement (to avoid confusion).

The first point below - the best solution would be to make the named query name 
unique though addition of parameters or numeric increment, ideally only if 
there are multiple overloaded methods. That may require some code in the 
Hibernate cartridge, in order to minimize the logic contained within the 
templates.

Thanks,


Bob Fields
From: u.schmel...@online.de
To: andromda-devel@lists.sourceforge.net
Date: Thu, 12 Dec 2013 09:43:28 +0100
Subject: [Andromda-devel] Migration problems from 3.2

Hi again,

 

there are some problems I found in the progress of migration:

 

1.) named query generation:

 

assumed an modelled entity (argouml, uml14) like this:

 

+-----------------------------------------------+

|                    <<Entity>>                         |

|                      MyEntity                            |

+-----------------------------------------------+

|                                                               |

 

+-----------------------------------------------+

|<<FinderMethod>> find(String):Collection |

|<<FinderMethod>> find(int,int):Collection |

+-----------------------------------------------+

 

this would generate the following named queries:

@Entity

@NamedQuery

({

    @NamedQuery(name="MyEntity.find", query="someQuery"),

    @NamedQuery(name="MyEntity.find", query="someOtherQuery")

})

A workaround is, to rename those finder methods instead of having different 
method signatures.

 

2.) Modelling precission of BigDecimal Attributes

With 3.2 it was possible to tag such an attribute with length=precission, scale 
to get the a DECIMAL(precission,scale) generated.

The current version would generate something like this:

@Column(... ..., length=12,4)

which is invalid syntax. Tried to use 
@andromda.persistence.column.precision/scale instead, but this is not detected 
by the generator

3.) Some other tagging doesn't have effect like:

@andromda.persistence.temporalType, which has to be generated for Date fields 
like @Temporal(javax.persistence.TemporalType.DATE)

 

Maybe someone can give some hints how to fix this. The first point seems to 
require a design decission.

 

regards Uwe




------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
                                          
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk

Reply via email to