-->
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.  [ 9 posts ] 
Author Message
 Post subject: mapping to java.io.File
PostPosted: Fri May 21, 2004 12:15 pm 
Regular
Regular

Joined: Thu Aug 28, 2003 10:54 am
Posts: 67
I am curious how people map file names and directory paths. These are all varchar in the db but do you use Strings in your objects or do the conversion to file objects in the setter or ....

How do I get/set File objects with hibernate.

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 12:16 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Use a custom PropertyAccessor.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 12:18 pm 
Regular
Regular

Joined: Thu Aug 28, 2003 10:54 am
Posts: 67
is there anywhere I can see an example of this?


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 12:20 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Hibernate is Open Source.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 12:27 pm 
Regular
Regular

Joined: Thu Aug 28, 2003 10:54 am
Posts: 67
so are you suggesting i try and figure out how to use this feature from its implementation in the source code? There is no documentation or examples or even sample code ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 12:30 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
1. What you are trying to do is extremely trivial.

2. The "example" you are looking for is, as always with Open Source software, the source code.

3. There is an API documentation for the two trivial methods you have to implement in the Hibernate API documentation.

4. You probably haven't even looked for it.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 12:34 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Ah sorry, I meant a custom UserType, not a PropertyAccessor. There are lots of examples of UserTypes in the wiki area, and the interface is quite trivial.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 12:46 pm 
Regular
Regular

Joined: Thu Aug 28, 2003 10:54 am
Posts: 67
1. being new to hibernate, how should i know whether its trivial or not. Thats why I'm in the hibernate beginners forum.

2. This makes no sense. If this is true why is there any documentation for hibernate at all? or for any open source project? Seems like a waste of time for Gavin to write a book when he should just tell people to look at the source code.

3. trivial or not its not unusual to look around for other attempts to do something similar in case of hidden problems, undocumented issues etc. I always thought that this is what public forums are for.

4. No, thats true. Up until 20 minutes ago I had not idea these methods existed or what they might be used for. I'd still find it easier to see concrete code examples but if they don't exist i'll have to resort to the source code for sure.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 12:51 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
http://www.hibernate.org/hib_docs/refer ... n-property
http://www.hibernate.org/hib_docs/api/n ... essor.html

I've written the book, by the way.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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