cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@mobilebox.pl>
Subject Re: OT: O/R collection mapping [was: SQLTransformer]
Date Wed, 07 Sep 2005 05:53:17 GMT
Antonio Gallardo wrote:
> Not sure is there can be a usecase where you will not need to store a 
> value in the DB. But, let assume the special usecase exists, then the 
> additional index should be "optional" and not obligatory as is now in 
> hibernate. ;-)
It is obligatory for mapping a List. You can map your collection as Set 
and do not need index then.

> I also noted [0]: "The index of an array or list is always of type 
> integer."
Again: this is the context of List mapping.

> 
> Again, this is a non-sense: Obligatory index + obligatory index type!
> 
> Of course, this does not cover cases where the user prefer to use 
> another index type, for example a string or a char or whatever other 
> type the user want to use. This is another reason to choose Apache OJB 
> [1]. The worse is that instead of offer a solution in hibernate 3, they 
> offer just "a cool justification" why this non-sense [0]. I really 
> wonder how is people using hibernate after all. The only answer I found 
> is "they must have an excelent marketing engine a la 
> ${readerPreferedCorporate.getName()}". ;-)
There is completely no problem to use another index type but this is not 
List then. How would you like to index your list with non integers when 
java.util.List is indexed with integers only?

For your usecase you should map your collection as java.util.Map.

I am doing hibernate almost 2 years now and haven't found a single 
usecase where I would have to adjust my database schema just because I'm 
using hibernate.

I am sure both OJB and Hibernate would do just fine for 99% cases. We 
could bring up a lot of arguments and the other side could probably 
easily turn them down. Let's maybe do it like this: You create a 
database schema which you map to OJB and I will provide hibernate 
mappings. Then I will challenge you :) We can put results on wiki so our 
users see that both O/R techniques are feasible for single database 
schema. WDYT?
-- 
Leszek Gawron                                      lgawron@mobilebox.pl
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Mime
View raw message