-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: transient properties in orm.xml
PostPosted: Wed Nov 21, 2007 8:27 am 
Newbie

Joined: Wed Nov 21, 2007 8:16 am
Posts: 10
Hibernate version: 3.2.1.ga

Mapping documents: orm.xml and persistence.xml

Hello
How can i avoid that Hibernate tries to persist transient properties.

I'm not using annotations because i want my domain model as clean as possible, and i don't want to deploy the hibernate libraries together with my client code.

Therefore i'm using orm.xml and persistence.xml on my repository layer.

In the standard orm it is possible to specify a property with
Code:
<transient name="foo" />

to tell jpa that this property should not be persisted

This doesn't seem to work with Hibernate

Any workarounds except for using annotations?

/Per-Jarle


Top
 Profile  
 
 Post subject: Re: transient properties in orm.xml
PostPosted: Wed Nov 21, 2007 11:26 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
per-jarle wrote:
I'm not using annotations because i want my domain model as clean as possible, and i don't want to deploy the hibernate libraries together with my client code.

Even if you add annotations to a domain model, you don't have to deploy the annotations jar in the classpath (annotations will then be ignored). I think that should solve your problem :)

Quote:
In the standard orm it is possible to specify a property with
Code:
<transient name="foo" />

to tell jpa that this property should not be persisted

This doesn't seem to work with Hibernate

Can you write a simple test case and post it to JIRA? This might be a bug.

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Re: transient properties in orm.xml
PostPosted: Thu Nov 22, 2007 5:02 am 
Newbie

Joined: Wed Nov 21, 2007 8:16 am
Posts: 10
emmanuel wrote:
per-jarle wrote:
I'm not using annotations because i want my domain model as clean as possible, and i don't want to deploy the hibernate libraries together with my client code.

Even if you add annotations to a domain model, you don't have to deploy the annotations jar in the classpath (annotations will then be ignored). I think that should solve your problem :)

Quote:
In the standard orm it is possible to specify a property with
Code:
<transient name="foo" />

to tell jpa that this property should not be persisted

This doesn't seem to work with Hibernate

Can you write a simple test case and post it to JIRA? This might be a bug.


My bad...
I created a clean empty project for the testcase i wanted to submit.

When creating the pom.xml i found out that i had an old library mixed in within my dependencies.

Removing this library solved the problem

Anyway...
I would have struggled to find this bug if i should continue with my existing project, so thanks for your help

-- Case closed --

/Per-Jarle


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.