-->
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.  [ 5 posts ] 
Author Message
 Post subject: default values for properties
PostPosted: Tue Jan 25, 2005 5:54 am 
Newbie

Joined: Wed Oct 13, 2004 5:32 am
Posts: 8
Hibernate version:3.0beta

Mapping documents:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<class name="de.xxx.XXXX" table="XXXXX">
<id name="id" column="id" type="long">
<generator class="increment"/>
</id>
<property name="valid" not-null="false" type="timestamp"/>
<property name="stream" not-null="false" type="blob" insert="false"/>
<property name="Info" column="info" not-null="false"/>
</class>
</hibernate-mapping>



hi,

i have the above hibernate-xml-file.
it works fine. but i have one problem:
<property name="stream" not-null="false" type="blob" insert="false"/>

i need something like:
<property name="stream" not-null="false" type="blob" insert="false" default="empty_blob()" />

how can i realize this? the dtd says, that there is no parameter "default" for property.

plz help me :-)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 25, 2005 9:11 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Can't do that, this is a nice feature however.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 3:54 am 
Newbie

Joined: Wed Oct 13, 2004 5:32 am
Posts: 8
:-(


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 1:51 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Come on don't be sad. It's open source, make a patch :-)

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 2:04 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
you can set default properties in constructor of persistent class

regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.