You shouldn't need to generate DAOs, Managers, etc. for the child. If you're managing the object from the parent, you should be able to use the Parent's DAO for everything. If you do end up needing a DAO and Managers for the child, you don't need to write Java code to do that - you can do it easily enough just by writing Spring bean definitions.

Hope this helps,

Matt

On Dec 1, 2007, at 10:48 AM, Mani_N wrote:



So how about dao's and manager's that are generated by appfuse:gen for 2
related entities (like parent and child) Will they have support for
this.........

Suppose Memotype is Parent and Memorandum is child

How to write a sample test case in core module to test
Memorandum.getMemotype().getMemoTitle() value?

Please help...


mraible wrote:

Comments below...

On Dec 1, 2007, at 3:06 AM, Mani_N wrote:


Hi,

Environment Used:
Maven: 2.0.7
Pattern: Spring MVC Modular
Appfuse: 2.0.1
Java: 1.5
Database: MYSQL
Persistence Framework: Hibernate


I have two tables with following structure......

CREATE TABLE `memotype` (
 `memoTitle` varchar(255) NOT NULL,
 `memo_desc` varchar(50) default NULL,
 PRIMARY KEY  (`memoTitle`)
) ENGINE=InnoDB;

CREATE TABLE `memorandum` (
 `fromPer` varchar(255) NOT NULL,
 `to_person` varchar(50) default NULL,
 `memoTitle` varchar(255) NOT NULL,
 PRIMARY KEY  (`fromPer`),
 KEY `memoTitle` (`memoTitle`),
 CONSTRAINT `memorandum_ibfk_1` FOREIGN KEY (`memoTitle`) REFERENCES
`memotype` (`memoTitle`) ON DELETE CASCADE
) ENGINE=InnoDB;

Am creating entities using appfuse:gen-model. Am getting the two
entities
but by default am getting id generators on top of get methods of
primary
keys whereas they should not be auto generated values. Anyway am
removing
those generator strategies from the primary key fields and using
appfuse:gen
in core and web modules for generating the code.

The test cases were failing in web module, so i used -
Dmaven.test.skip=true
while mvn install

And given the command mvn cargo:start -Dcargo.wait=true for starting
the
tomcat........... and opened the browser.

I was expecting a combo box for memoTitle in memorandumForm.html
screen to
select memoType from memoTypes which are already there. But there is
no
field memoTitle at all in that screen. It has only two fields
fromPer and
toPer.

Did appfuse doesnt have support for parent child relationships?

No, not in appfuse:gen. It's a feature we'd like to add, but we need
more knowledge to do so. If you know what the pattern might look like
- you're more than welcome to modify the FreeMarker templates to
produce the code you're looking for. We recently added the ability to
customize templates in your project for AMP. If you change your
appfuse-maven-plugin to version 2.0.2-SNAPSHOT, you should be able to
extract all the templates from the AMP JAR to src/test/resources/
appfuse and your templates will be used instead of the ones in AppFuse.


And is there
a way to specify to consider all entities in com.mycompany.app.model
package
like "*" in appfuse:gen instead of using appfuse:gen for each entity
in
application?

No, but you could probably modify the code to do this pretty easily.
Here's a link showing you how to get the AMP plugin from SVN.

http://tinyurl.com/27set9

Matt





--
View this message in context:
http://www.nabble.com/Is-it-possible-to-use-parent-and-child- entities-with-appfuse-tf4927572s2369.html#a14103452
Sent from the AppFuse - User mailing list archive at Nabble.com.

-------------------------------------------------------------------- -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
View this message in context: http://www.nabble.com/Is-it-possible- to-use-parent-and-child-entities-with-appfuse- tf4927572s2369.html#a14107687
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to