Hi all,

I am impressed with the work of andromda team. I am sure that andromda can do my job easier :-).

   I want ask you for two things.

1. I try to extend hibernate cartridge. I need values object in model, they should be interpreted as hibernate component. First of all I have tried to add new stereotype (Value) to cartridge (I think it is better to use ValueObject from java cartridge, but it comes later). I added to andromda-cartridge.xml template element:

    <template
        sheet="templates/HibernateValue.vsl"
        outputPattern="{0}/{1}.java"
        outlet="values"
        overWrite="true">
        <modelElements variable="class">
            <modelElement stereotype="Value"/>
        </modelElements>
    </template>

and template to src/templates. When I try to build my project with my new hibernate cartridge (I use maven) I get such error:


<verbatim>

andromda:run:
[echo] +--------------------------------------------+
[echo] | R u n n i n g A n d r o M D A |
[echo] +--------------------------------------------+
19:59:20,635 INFO [CartridgeFinder] found cartridge --> 'hibernate'
19:59:20,739 INFO [CartridgeFinder] found cartridge --> 'spring'
19:59:25,898 INFO [andromda] Input model --> 'jar:file:/home/tlempart/workspace/BusinessTrip/mda/src/uml/BusinessTrip.xml.zip!/BusinessTrip.xml'
19:59:32,119 INFO [MetafacadeMappings] found metafacades --> 'default'
19:59:32,991 INFO [hibernate] Output: 'file:/home/tlempart/workspace/BusinessTrip/mda/../hibernate/target/src/java/pl/sst/businesstrip/model/Role.java'
19:59:33,221 ERROR [DefaultAndroMDACartridge] Error performing DefaultAndroMDACartridge.processWithTemplate with template 'templates/HibernateEntity.vsl', template context '[EMAIL PROTECTED], [EMAIL PROTECTED]' and cartridge 'hibernate'
org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getColumnName' in class org.andromda.metafacades.uml14.EntityAssociationEndFacadeLogicImpl threw exception class java.lang.ClassCastException : null
at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:193)


</verbatim>       

The problem is association (one to one) between Entity and Value. It looks like stereotype Value is interpreted as Classifier and not Entity and it is good for me but why andromda try to cast it to Entity? How can I associate some stereotype with uml element (i.e. Classifier or Entity). I checked hibernate cartridge and I could not find association between Entity stereotype and Entity facade.

2. I want to use Spring instead of EJB so I created spring cartridge with one stereotype Service. I use it instead of Service from hibernate cartridge. It works :-) but I feel it is not perfect solution. I think there should be some way in hibernate cartridge to choose kind of service (ejb, spring or something else). There could be division of stereotype Service into two or more Services i.e. ServiceEJB, ServiceSpring ... but it does not look perfectly for me. Do you know some other solution?

   Thanks Tomek


------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click _______________________________________________ Andromda-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to