Discussion:
[Middlegen-user] finder methods
Brent Craig
2002-09-02 20:09:26 UTC
Permalink
I am using mysql. When I define a numeric type in mysql the bean method
representing the field returns and sets a java.math.BigDecimal. How can I
change this to another java type?

Also, if I want to dictacte the finders that I want to be created (instead
of all fields except pk's and fk's) do I need to modify the entity-20-cmp.vm
file?

Thanks


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
Aslak Hellesøy
2002-09-02 20:46:39 UTC
Permalink
Hi. I assume you're using Middlegen from CVS.
-----Original Message-----
Craig
Sent: 3. september 2002 00:07
Subject: [Middlegen-user] finder methods
I am using mysql. When I define a numeric type in mysql the bean method
representing the field returns and sets a java.math.BigDecimal. How can I
change this to another java type?
Run Middlegen in gui mode. Select the columns you want to change in the
upper panel and modify the java type in the combo in the lower panel. When
you exit, Middlegen will remember your settings in your xxx-prefs.properties
file, so you can run without gui in the future and get the same result.
Also, if I want to dictacte the finders that I want to be created
(instead
of all fields except pk's and fk's) do I need to modify the
entity-20-cmp.vm
file?
No need to change the template. Use the new, nifty logical predicates:
http://boss.bekk.no/boss/middlegen/predicates.html

You can only specify global rules, not on a per-table basis.

If you want full control of the finders per table, turn off generated
finders, e.g. with
<finders>
<false/>
</finders>

and use merge files to add custom @ejb.finder tags in the generated beans
http://boss.bekk.no/boss/middlegen/plugins/cmp20.html (look for
pluginname-tablename-class-comments.txt at the bottom)

The airline sample illustrates how both of these features are used (some of
it is commented out for you to un-comment).

You should do a CVS update. I just fixed a little bug related to this.

HTH,
Aslak
Thanks
_________________________________________________________________
http://photos.msn.com/support/worldwide.aspx
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Loading...