Joined: Tue May 17, 2005 5:31 pm Posts: 4
|
I have done the above trick a number of times previously to get performance enhancements when queries on the child table are unlikely.
Say for example that I have a table for rule configurations and the child table (or the idea that I need a child table) for parameters for these rules.
What I'd do if I did it by hand would be to have a class "Rule" and another called "Parameter" but I would serialize all parameters for a rule into a column of the rule table, elliminating the need for a "Parameter" column.
How would this be done in Hibernate? I've read the documentation and came across "UserType" which seems on the way but this doesn't seem to deal with collections. Would it be UserCollectionType which would be appropriate to serialize my "Parameter"s in to a "Rule" column?
Another complicating factory is that Oracle only allows 4000 digits in a VARCHAR2 column so that is 2000 serialized and hexcoded bytes. In my previous hand-coded classes my DAOs check whether we're over the limit and then serialize the data to a BLOB column instead but this is much slower of course.
Any ideas?
|
|