[Hibernate] Primitive types and null

2003-11-14 Thread Prasad Iyer



Hi,
We are migrating existing project. 

I came across the problem I have beans 
with primitive type. When the corresponding persistent value in database is 
null. The whole application fails. Gives the error that null cannot be assigned 
to primitive values
I totally agree with this 
behaviour.
 
So I am changing my whole primitives to 
wrapper classes.(ie float -> Float , char -> Character). Or is there any 
cheeze way to bypass this.

Am I doing this right 
Your reply would be highly appreciated. 

Please suggest.
regards
prasad 
chandrasekaran.


Re: [Hibernate] Primitive types and null

2003-11-14 Thread Gavin King
You *could* use a UserType to workaround

Prasad Iyer wrote:

Hi,
We are migrating existing project.
I came across the problem I have beans with primitive type. When the 
corresponding persistent value in database is null. The whole 
application fails. Gives the error that null cannot be assigned to 
primitive values
I totally agree with this behaviour.
 
So I am changing my whole primitives to wrapper classes.(ie float -> 
Float , char -> Character). Or is there any cheeze way to bypass this.
Am I doing this right
Your reply would be highly appreciated.
Please suggest.
regards
prasad chandrasekaran.
--
Gavin King
JBoss Group
+61 410534454
http://hibernate.org


---
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


[Hibernate] EHCache and JDK1.4

2003-11-14 Thread Greg Luck
Hi

EHCache does require the use of JDK1.4.

Specifically we use:

- LinkedHashMap, which provides us with an LRU HashMap
- JDK1.4 logging
- SoftRefererences
I guess there is a lot of production code out there on JDK1.3 and 
earlier. I could replace
the JDK1.4 logging with commons logging and the java.util.LinkedHashMap 
with something
similar.

I was pretty keen to use the java.util.LinkedHashMap, because the 
combination of a doubly-linked
list combined with a Hashmap in JCS was the source of the memory leak 
in it. The memory store code
went from around 1500 lines down to a few hundred and became much 
simpler to understand.

Greg Luck



---
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Re: [Hibernate] EHCache and JDK1.4

2003-11-14 Thread Christian Bauer
On 15 Nov (09:10), Greg Luck wrote:

> I was pretty keen to use the java.util.LinkedHashMap, because the 
> combination of a doubly-linked
> list combined with a Hashmap in JCS was the source of the memory leak 
> in it. The memory store code
> went from around 1500 lines down to a few hundred and became much 
> simpler to understand.

Instead of a requirement for JDK 1.4, can you replace the 1500 lines of
code with something better and only use 1.3? Gavin, I'm rewriting/adding
the cache documentation, and some things are not perfectly clear, like
the future for JCS and our "recommended", easy to install/config bundled
cache.

I'd say JDK 1.3 compatibility is a must for Hibernate, it even was for
the last projects I did.

-- 
Christian Bauer
[EMAIL PROTECTED]


---
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


[Hibernate] Random object query

2003-11-14 Thread Ron Forrester
How can I do something like the following, the hibernate way??

select * from foo where bar='baz' order by RAND() LIMIT 0,1;

Of course what I am doing here is selecting a single random row (object)

Thanks,
Ron


---
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Re: [Hibernate] EHCache and JDK1.4

2003-11-14 Thread Gavin King
We already have a dependency to commons-collections, so perhaps just use 
commons SequencedHashMap instead of LinkedHashMap.

Greg Luck wrote:

Hi

EHCache does require the use of JDK1.4.

Specifically we use:

- LinkedHashMap, which provides us with an LRU HashMap
- JDK1.4 logging
- SoftRefererences
I guess there is a lot of production code out there on JDK1.3 and 
earlier. I could replace
the JDK1.4 logging with commons logging and the java.util.LinkedHashMap 
with something
similar.

I was pretty keen to use the java.util.LinkedHashMap, because the 
combination of a doubly-linked
list combined with a Hashmap in JCS was the source of the memory leak in 
it. The memory store code
went from around 1500 lines down to a few hundred and became much 
simpler to understand.

Greg Luck



---
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel
--
Gavin King
JBoss Group
+61 410534454
http://hibernate.org


---
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


[Hibernate] JavaPolis

2003-11-14 Thread Gavin King
http://www.bejug.org/bejugPortal/appmanager/BeJUG/JP03?_nfpb=true&_pageLabel=P4022

see anyone we know?

--
Gavin King
JBoss Group
+61 410534454
http://hibernate.org


---
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


[Hibernate] Re: hibernate problem

2003-11-14 Thread Prasad Iyer
hi,
I solved this problem by using the new oracle driver.
regards
prasad chandrasekaran
- Original Message -
From: "Dongli Zhang" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 14, 2003 10:43 PM
Subject: hibernate problem


> hi prasad,
>
> I have the same problem with you.
> How do you work it out?
>
> Thanks.
>
> dongli zhang
>
>
> ---
> I get this error can anyone help me in solving this
> java.lang.AbstractMethodError:
> oracle.jdbc.driver.OracleDatabaseMetaData.supportsResultSetType(I)Z
>
> at
>
net.sf.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:163)
>
> at
>
net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:59
4)
>
> at org.presci.walnut.EmployeeImpl.(EmployeeImpl.java:28)
>
> Exception in thread "main"
>
> regards
> prasad chandrasekaran
>
>



---
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel