Hello again,
i'm trying to extend the Hibernate cartridge using AOP in order to generate
an additional mapping for interfaces using the <any> tag.

i've changed the workflow adding this lines:

    <component adviceTarget="hibernateCartridge_mapping_generator"
            id="reflectionAdvice"
            class="oaw.xpand2.GeneratorAdvice" >
        <metaModel class="oaw.uml2.UML2MetaModel"/>
        <advices value="templates::AopTemplate"/>
    </component>

And my template (AopTemplate) is:

«IMPORT ecore»
«IMPORT uml»
«IMPORT persistence»

«AROUND
org::fornax::cartridges::uml2::hibernate::templates::HibernateConfig::Mappings
FOR uml::Class-»
        «EXPAND finalBlock FOREACH this.interfaceRealization-»
        «targetDef.proceed()-»
«ENDAROUND»

«DEFINE finalBlock FOR uml::InterfaceRealization-»
        «FOREACH (List[uml::Interface])this.supplier AS sup-»
                <any name="«sup.name»" id-type="long" meta-type="string">
                «FOREACH
(List[uml::InterfaceRealization])sup.getTargetDirectedRelationships() AS
intReal-»
                        «FOREACH (List[uml::Class])intReal.client AS cli-»
                        <meta-value value="«tableName()»
class="«getFQNOfImplementationClass()»"/>
                        «ENDFOREACH-»
                «ENDFOREACH-»
                </any>
        «ENDFOREACH-»
«ENDDEFINE»


My problem regards the use of extensions that are defined in the hibernate
cartridge... the "tableName()" and "getFQNOfImplementationClass()" are
methods already implemented in the extensions of the hibernate cartridge and
i haven't found a way to use them in my template.

Moreover i didn't understood why the objects that are intercepted by my
Around function are of type uml::Class and not of type persistence::Entity
as defined in the original code of the hibernate cartridge.

I can't found an esaustive documentation for templates and extensions aop.

Ex.:
This should be the resultant mapping for the problem i've exposes in my
first post.

<any name="DocAssociable" id-type="long" meta-type="string">
    <meta-value value="TB_USER" class="User"/>
    <meta-value value="TB_PROJECT" class="Project"/>
    <column name="table_name"/>
    <column name="id"/>
</any>

Any help will be very appreciated.
Thanks.
Carlo
-- 
View this message in context: 
http://www.nabble.com/-JSF-uml2-cartridge--interface-troubles-tp25530358s17564p26091249.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Fornax-developer mailing list
Fornax-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to