Re: <cache> settings in Hibernate mapping files generated by Middlegen

Eivind Waaler <[email protected]> Fri, 22 Oct 2004 10:39:10 +0200 (CEST)
Newsgroups gmane.comp.java.ejb.middlegen.user
Message-ID <[email protected]>
I don't think the <cache> element is supported by Middlegen yet. To add
support yourself, check out the source from cvs and add it to the
hibernate.vm file in the hibernate plugin directory.

.eivind

On Thu, 21 Oct 2004, bruce sherrod wrote:

>
> Is it possible to set the <cache usage="..."> tags in the hibernate
> mapping files, when using middlegen to generate the mappings?
>
> My build.xml reads as follows:
>
>        <target name="middlegen" description="Run Middlegen to generate .hbm from live running database" >
>                 <echo message="Class path = ${basedir}"/>
>                 <taskdef
>                         name="middlegen"
>                         classname="middlegen.MiddlegenTask" />
>                 <property name="name" value="foo"/>
>                 <middlegen
>                                 appname="${name}"
>                                 prefsdir="${src}"
>                                 gui="${gui}"
>                                 databaseurl="${database.url}"
>                                 initialContextFactory="${java.naming.factory.initial}"
>                                 providerURL="${java.naming.provider.url}"
>                                 datasourceJNDIName="${datasource.jndi.name}"
>                                 driver="${database.driver}"
>                                 username="${database.userid}"
>                                 password="${database.password}"
>                                 schema="${database.schema}"
>                                 catalog="${database.catalog}" >
>                         <hibernate
>                                 destination="${src}"
>                                 package="com.foo.db"
>                                 javaTypeMapper="middlegen.plugins.hibernate.HibernateJavaTypeMapper"
>                                 standardGeneratorScheme="vm"
>                         />
>                 </middlegen>
>         </target>
>
> Mapping files that created look, for example, like this:
>
>     <hibernate-mapping>
>     <!--
> 	Created by the Middlegen Hibernate plugin 2.1
>
> 	http://boss.bekk.no/boss/middlegen/
> 	http://www.hibernate.org/
>     -->
>
>     <class
> 	name="Account"
> 	table="account"
>     >
> 	<id
> 	    name="id"
> 	    type="java.lang.Integer"
> 	    column="id"
> 	>
> 	    <generator class="vm" />
> 	</id>
> 	...
>
> I'd really like the mapping files to have, say, this:
>
>     <class
> 	name="Account"
> 	table="account"
>     >
> 	<cache usage="read-write"/>   <----- this is what I want to have added!
> 	<id
> 	    name="id"
> 	    type="java.lang.Integer"
> 	    column="id"
> 	>
> 	    <generator class="vm" />
> 	</id>
> 	...
>
> How do I do this?
>
> Thanks,
> -- Bruce
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
> Use IT products in your business? Tell us what you think of them. Give us
> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
> http://productguide.itmanagersjournal.com/guidepromo.tmpl
> _______________________________________________
> middlegen-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/middlegen-user
>
>


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl