Same problem here. Please help us! Fabio
Asgaar wrote: > > hi there, i'm testing jsf cartridge 1.2 to use it in a new project... > i'll try to explain the problem i'm facing: > i've modelled a concrete class "Document" which is associated many-to-many > to an interface "DocAssociable", the association in navigable on the > "Document" end; the interface is implemented by 2 concrete classes "User" > and "Project"... > > The problem concern how the constraints are generated: > > alter table DOCASSOCIABLE_DOCUMENT > add constraint FKDF8F1BD440B969CD > foreign key (docsid) > references TB_DOCUMENT; > > alter table DOCASSOCIABLE_DOCUMENT > add constraint FKDF8F1BD4B6FB8C70 > foreign key (docownersid) <-- This docownersid references two > tables at the same time > references TB_PROJECT; > > alter table DOCASSOCIABLE_DOCUMENT > add constraint FKDF8F1BD499B9E45A > foreign key (docownersid) <-- This docownersid references two > tables at the same time > references TB_USER; > > I've found another problem which is raised if i declare the association > bidirectional: > > The ComponentFactory contains this wrong code related to the concrete > classes which implements the interface "DocAssociable": > > /** > * @return The User entity als prototype with all attributes > */ > public final User getUserWithFullAttributes(final long id, > final String dac, final String username, > final Set<DocAssociable> docOwners, final Set<Project> projects, > final Set<Document> docs) { > User bean = (User) context.getBean("user"); > bean.setId(id); > bean.setUsername(username); > bean.setDocOwners(docOwners); <-- This is the interface > implemented by the User class > bean.setProjects(projects); > bean.setDocs(docs); > return bean; > > } > > /** > * @return The Project entity als prototype with all attributes > */ > public final Project getProjectWithFullAttributes(final long id, > final String dac, final Set<DocAssociable> docOwners, > final String code, final Set<User> users, final Set<Document> > docs) { > Project bean = (Project) context.getBean("project"); > bean.setId(id); > bean.setDocOwners(docOwners); <-- This is the interface > implemented by the Project class > bean.setCode(code); > bean.setUsers(users); > bean.setDocs(docs); > return bean; > > } > > ===== > > The interface has been generated because i added in the workflow a call to > this template: > > «IMPORT uml» > «IMPORT Spring2» > «IMPORT Persistence» > > «EXTENSION org::fornax::cartridges::uml2::javabasic::extensions::DataType» > «EXTENSION org::fornax::cartridges::uml2::javabasic::extensions::Helper» > «EXTENSION org::fornax::cartridges::uml2::hibernate::extensions::Naming» > «EXTENSION org::fornax::cartridges::uml2::spring::extensions::Spring» > «EXTENSION > org::fornax::cartridges::uml2::spring::extensions::DaoOperationsHelper» > > /** > * The entry point for the generation > */ > «DEFINE Root FOR uml::Model» > «EXPAND Root FOREACH (List[uml::Package])ownedElement» > «ENDDEFINE» > > /** > * Creates all packages > */ > «DEFINE Root FOR uml::Package» > «EXPAND > org::fornax::cartridges::uml2::javabasic::m2t::Interface::interface > FOREACH ownedType.typeSelect(uml::Interface)» > «EXPAND Root FOREACH nestedPackage» > «ENDDEFINE» > > > /** > * Dummy DEFINE for all elements with no generation purposes > */ > «DEFINE Root FOR Object» > «ENDDEFINE» > > using this tag right after the jsf cartridge tag: > > <component id="generator" class="oaw.xpand2.Generator" > skipOnErrors="true"> > <metaModel class="oaw.type.emf.EmfMetaModel" > metaModelPackage="org.eclipse.emf.ecore.EcorePackage"/> > <metaModel class="oaw.uml2.UML2MetaModel"/> > <metaModel > class="org.openarchitectureware.uml2.profile.ProfileMetaModel"> > > <profile value="${profile.persistence.file}" /> > </metaModel> > <fileEncoding value="ISO-8859-1"/> > > <globalVarDef name="java_version" value="${java.version}" /> > <globalVarDef name="java.version" value="${java.version}" /> > > <globalVarDef name="generate_additional_collection_methods" > value="${generate.additional.collection.methods}" /> > > <expand value="templates::SpecialCases::Root FOR model" /> > > <outlet path="${outlet.src.dir}"> > <postprocessor > class="org.hybridlabs.source.formatter.JavaImportBeautifier" > organizeImports="true" > format="true" /> > </outlet> > > <outlet name="outletSrcOnceDir" > path="${outlet.src.once.dir}" overwrite="false"> > <postprocessor > class="org.hybridlabs.source.formatter.JavaImportBeautifier" > organizeImports="true" > format="true" /> > </outlet> > > <prSrcPaths value="${outlet.res.dir}" /> > <prDefaultExcludes value="true" /> > > </component> > > > Could someone help me find a solution? > thank you very much. > > Carlo > -- View this message in context: http://www.nabble.com/-JSF-uml2-cartridge--interface-troubles-tp25530358s17564p25607498.html Sent from the Fornax-Platform mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Come build with us! The BlackBerry® 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/devconf _______________________________________________ Fornax-developer mailing list Fornax-developer@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fornax-developer