-->
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: Components and Containment
PostPosted: Mon Sep 08, 2003 4:28 am 
Newbie

Joined: Mon Sep 08, 2003 4:04 am
Posts: 4
Hello,

I have 2 questions:

1)

I would like to have access to the meta-information regarding whether a property maps to a non-null column, and to the column's size in the database. For instance, I would like to check the size of strings in the GUI code. Unfortunately, I don't see this information in anything reachable from ClassMetadata. Is there a way to navigate from ClassMetadata to the ColumnMetadata?

2)

I have an large entity that that is decomposed into a hierarchy of fine grained components, nested 3 or 4 levels deep. Hibernate maps empty components to null references, In my case, I would much rather have the components always be there, because otherwise the client code has the burden of testing for null values, and initializing when necessary.

Is there a way to turn off the mapping of components to nulls?


Thanks in advance for the help,
Ron


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 08, 2003 5:05 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
(1) Try Configuration.getClassMapping()

(2) If its a once off, use a CompositeUserType


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 08, 2003 5:51 am 
Newbie

Joined: Mon Sep 08, 2003 4:04 am
Posts: 4
Thanks for the quick reply. Just so I don't go down the wrong path here, let me impose on you one more time.

Regarding configuration.getClassMapping: Do you mean I should use PersistentClass.getPropertyIterator to get the properties as they are named in my classes, and then use getColumnIterator to retrieve the data about the schema? I guess Configuration is not thread safe, what about the other classes involved here. Should I harvest all the information I need at start-up time?

Thanks again,
Ron


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.