<cache> settings in Hibernate mapping files generated by Middlegen
bruce sherrod <[email protected]> Thu, 21 Oct 2004 12:36:56 -0700
| Newsgroups | gmane.comp.java.ejb.middlegen.user |
|---|---|
| Message-ID | <[email protected]> |
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