Re: [Hibernate] composite-id still doesn't work for me...

2003-01-23 Thread Gavin . King

Of course!

Its a FAQ item that assigned ids including composite ids can't distinguish
between a
saved or unsaved object (you have a choice between "always update" or
"always insert").

So if you want to add a new child (with unsaved-value="none"), simply save
() it
manually first:

child.setParent(parent);
parent.addChild(child);
session.save(child);
session.update(parent);

None of these things are issues if you use synthetic ids, as is best
practice for all
sorts of other reasons (see Scott Ambler's paper).





   
   
"Raible, Matt" 
   
<[EMAIL PROTECTED]> To: "'[EMAIL PROTECTED]'"  
   
Sent by: <[EMAIL PROTECTED]>   
   
[EMAIL PROTECTED]   cc:
   
eforge.net  Subject: [Hibernate] 
composite-id still doesn't work for me...
   
   
   
   
23/01/03 05:10 AM  
   
   
   
   
   




I just did a fresh checkout from CVS and updated my hibernate version.  I
can still retrieve data (and children) just fine, but not save it.

I noticed now that 's "unsaved-value" only allows "any" and
"none" - however, neither of these work for me:






results in:

[junit] WARN [main] JDBCExceptionReporter.logExceptions(35) | SQL
Error:
1407, SQLState: 72000
[junit] ERROR [main] JDBCExceptionReporter.logExceptions(42) |
ORA-01407: cannot update ("CCTADM
IN"."CMCF_MPS"."CCR_ID") to NULL

If I set unsaved-value="any", then I get:

[junit] WARN [main] JDBCExceptionReporter.logExceptions(35) | SQL
Error:
1, SQLState: 23000
[junit] ERROR [main] JDBCExceptionReporter.logExceptions(42) |
ORA-1: unique constraint (CCT
ADMIN.CMCF_MPS_PK) violated

My  mapping to this class is:






I guess I'll remove my "bag" mappings and populate my child object manually
as this obviously isn't working for me ;-)

Thanks,

Matt




---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel




**
Any personal or sensitive information contained in this email and
attachments must be handled in accordance with the Victorian Information
Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988
(Commonwealth), as applicable.

This email, including all attachments, is confidential.  If you are not the
intended recipient, you must not disclose, distribute, copy or use the
information contained in this email or attachments.  Any confidentiality or
privilege is not waived or lost because this email has been sent to you in
error.  If you have received it in error, please let us know by reply
email, delete it from your system and destroy any copies.
**





---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



[Hibernate] [ hibernate-Bugs-672639 ] HB2 generating incorrect join query

2003-01-23 Thread SourceForge.net
Bugs item #672639, was opened at 2003-01-23 06:08
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428708&aid=672639&group_id=40712

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Simon Harris (haruki_zaemon)
Assigned to: Nobody/Anonymous (nobody)
Summary: HB2 generating incorrect join query

Initial Comment:
I have the following classes:

Party 1:1 Membership

Party joined-sub-classes Person, Company

When executing a query to find a Person, the following 
two sql statements are executed:

SELECT Membe1_.id as id0, Membe1_.versionId as 
versionId0, Perso0_.partyId as partyId1, 
Perso0_.versionId as versionId0_1, Perso0_.loginName 
as loginName0_1 FROM Party Perso0_, Person 
Perso0__1, Membership Membe1_ WHERE 
Perso0_.partyId=? and Perso0_.partyId=Membe1_.id(+)

followed by:

SELECT Membe0_.id as id, Membe0_.versionId as 
versionId FROM Membership Membe0_ WHERE 
Membe0_.id=?

Firslty, I'm not quite sure why the second query is 
generated at all but more importantly, you will notice the 
addition of an extra table in the FROM clause of the first 
query:

Person Perso0__1

Which is not needed and causes multiple results to be 
returned.

I noticed this when I submitted some patches for the 
decode stuff. I realise hb2 is still beta but I wanted to 
document it anyway. I'll look into this problem and see 
what I can find unless someone else has a slap the 
forehead DOH! moment and realises what is going 
wrong first :-)

Cheers,

Simon

--

>Comment By: Gavin King (oneovthafew)
Date: 2003-01-23 10:25

Message:
Logged In: YES 
user_id=384580

Please, please post the mapping file; I can't reproduce this!

(Did you try the very latest CVS?)

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428708&aid=672639&group_id=40712


---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



[Hibernate] TODO

2003-01-23 Thread Gavin . King
Heres a list of outstanding things for the next month or so:

* add  @tag generation to hbm2java
* finish Middlegen plugin
* design new config API

I will be very busy for the immediate future, so if anyone is
interested in taking on any of these tasks, that would
be awesome. (They are all pretty fun things and don't
require deep understanding of Hibernate internals.) I
will do them myself, if I can't find anyone else, but I'm not
sure when I will be able to get a chance.


**
Any personal or sensitive information contained in this email and
attachments must be handled in accordance with the Victorian Information
Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988
(Commonwealth), as applicable.

This email, including all attachments, is confidential.  If you are not the
intended recipient, you must not disclose, distribute, copy or use the
information contained in this email or attachments.  Any confidentiality or
privilege is not waived or lost because this email has been sent to you in
error.  If you have received it in error, please let us know by reply
email, delete it from your system and destroy any copies.
**





---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



Re: [Hibernate] TODO

2003-01-23 Thread Max Rydahl Andersen
> * add  @tag generation to hbm2java

If anyone can point me to an example of what is expected for this
generation, then i'll be glad to look into this one.

/max




---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



[Hibernate] Using factory methods to obtain new instances

2003-01-23 Thread Simon Stewart
Just a quick query: as I understand it, each Object that uses Hibernate 
for persistence needs to have a concrete class with an empty 
constructor. How hard would it be to modify Hibernate to call a method 
on a factory class instead of "new"? And how hard would it be to be 
able to pass a reference to this factory class to hibernate, to allow 
for non-static methods?

I ask because I tend to persist objects that act (at their most basic) 
as strongly typed Maps. These can be created on the fly using dynamic 
proxies from a basic interface. The rest should follow from there.

Regards,

Simon



---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Re: [Hibernate] Anyone up yet another philosophical comparison :)

2003-01-23 Thread Simon Stewart
On Thursday, Jan 23, 2003, at 08:01 Europe/London, 
[EMAIL PROTECTED] wrote:



I am sceptical until I see something work in practice. I have never 
ever
worked on a site where, once a system was in production, the DBA would
let me use my litte auto-schema-updater on the live database. I think 
this
person lives in a theoretical world where developers manage production
databases ;)

Power of Text. <<
I think I said that first, in the Hibernate FAQ.



Was I a little harsh on this guy? Sorry ;)
Just got your last point, cos it's only fair to point out that if this 
is a Martin Fowler backed project, the chances are that this has been 
developed in an "Extreme" manner, and probably has the easy support of 
extreme programming in mind as one of the (unstated) aims of the code. 
As a result, yes, he does live in a theoretical world where developers 
manage ... databases. :)

Were you a little harsh? I'm not the judge of that.

Regards,

Simon



---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


[Hibernate] Anyone up yet another philosophical comparison :)

2003-01-23 Thread Max Rydahl Andersen
http://jaxor.sourceforge.net/

A persistence layer "backed up" by the all and mighty Martin Fowler :)

Got some nice ideas...but one point made me wonder if Hibernate could do
same/better/worse!?:

On http://jaxor.sourceforge.net/whyJaxor.htm there is four headlines: Don't
Load More Data Than You Have To, Tell Me What Has Changed. Don't Make Me
Look!, Death to Duplication and Power of Text.

My comments for those blocks are:

Don't Load More Data Than You Have To

Talks about transparent lazy loading and about the "difficulties" of
handling proxies and special code for this.
Jaxor solves this by generating the code that handles this (e.g. generating
the proxies and the code for it).
Hibernate have done this "always" and it is event better today (my opnion):
It does not need to generate the proxies upfront by the power of cglib and
the code for it is inside hibernate (no need for special case codegeneration
for this).
Note: Jaxor seems to make a point of generating code instead of having
generel reflective codeI see advantages and disadvantages in both.

Tell Me What Has Changed. Don't Make Me Look!
Here is what it says:"Jaxor, through code generation, has the ability to
notify the session exactly when, where, and how objects are changed. In
contrast, frameworks using reflection must register the clean state of the
object when it's loaded, then upon committing the session the state of the
object is compared against it's original state to see if it has changed. If
thousands (or hundreds of thousands) of objects are loaded from the
database, committing these objects can be slower than necessary due to the
equality checks that have to be performed. Also, the state of the object is
duplicated in memory, so this may cause memory scalability problems. Jaxor
never suffers from these scalability problems. Objects are represented in
memory once. If they are updated, or deleted, then the session is notified
of the changed. No extra comparisons have to be done. "

And here I come short - Can't find what to say in Hibernates defence here ?
(How much "double state" does Hibernate need ?)

Death to Duplication
Well - this part is about generating code from metadata instead of manual
keeping code in sync with metadata. Here Hibernate rock :)
we got xdocbean2hbm and hbm2java and its constantly improving.

Second part is about having a "Database synchronization tool to match
mapping information to the database schema" about handling simple "deltas"
to a schema and INFORMING about columns/tables that the metadata does NOT
cover...(maybe we should start maturing schemaupdate and build a
schemacomparison "tool" ?)

Power of Text.
"Gui's are often wonderful marketing tools, but awful development tools" -
nuff said :) (and he continues " Even worse are gui's that don't work
directly with text files" :)
"If you are implementing a non-trivial (is there any other kind?)
application, and someone attempts to sell you an O/R mapping tool that
doesn't allow you to configure the mapping information with your favorite
text editor, run away. "... well, here Hibernate is all about text :)

Any comments  ? :)

/max



---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



Re: [Hibernate] any successful story with hibernate?

2003-01-23 Thread Gavin . King

Agreed; I know quite a few people have told me of their
successful projects via private email, but would it be
possible to share these stories in a more public way?

Just today, someone was telling me how they have just
finished porting their entity-bean based project to
Hibernate to (successfully) resolve some performance
issues. It would be great to get some details of those
kind of experiences!

I realise some people, myself included, have to be
somewhat circumspect in talking about what technology
they are using in actual projects, but this doesn't apply
to everyone.

If we could collect together some experiences of
actual concrete projects, I could publish them on the
Wiki site (either anonymously, or with a link to the
organisation).

TIA

Gavin

P.S. I don't like to compare Hibernate against
different products because

* I and others here are naturaly biased
* it is important to stay away from the kind flame
  wars that dominate some other open source
  communities

My standard answer is always: "install both
products, build a simple application with them,
pick the one you like best". I *strongly* encourage
you to take this approach when evaluating Hibernate
against any of the other opensource solutions out
there.




   
   
jiesheng zhang 
   
<[EMAIL PROTECTED]>To: [EMAIL PROTECTED]   
  
Sent by:cc:
   
[EMAIL PROTECTED]   Subject: [Hibernate] any successful 
story with hibernate? 
eforge.net 
   
   
   
   
   
23/01/03 05:50 PM  
   
   
   
   
   




Hi, guys
I am currently designing a Java project. I'd like to
use a Object relational mapping tool to manage the
persistnece layer. My friend suggests hibernate for
me.  Other people also warns me about the capability
of Object relation mapping solution. This makes me
worry about the hibernate capability.
I have two questions?
First is there a real example commercial application
which used hibernate?
What is the difference between object bridge hosted by
Apache and hibernate?

Thanks

jason


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com


---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel




**
Any personal or sensitive information contained in this email and
attachments must be handled in accordance with the Victorian Information
Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988
(Commonwealth), as applicable.

This email, including all attachments, is confidential.  If you are not the
intended recipient, you must not disclose, distribute, copy or use the
information contained in this email or attachments.  Any confidentiality or
privilege is not waived or lost because this email has been sent to you in
error.  If you have received it in error, please let us know by reply
email, delete it from your system and destroy any copies.
**





---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAI

Re: [Hibernate] Re: Anyone up yet another philosophical comparison :)

2003-01-23 Thread Gavin . King

Yes, which is problematic if you plan to use a common Hibernate
architecture
where the actual data model objects are exposed to the User Interface,
even in a three-tiered application. True transparent persistence lets you
do this in a philosophically pleasing way.




   
   
"Max Rydahl Andersen"  
   
<[EMAIL PROTECTED]>To: <[EMAIL 
PROTECTED]>   
Sent by:cc:
   
[EMAIL PROTECTED]   Subject: [Hibernate] Re: Anyone up yet 
another philosophical  
eforge.net   comparison :) 
   
   
   
   
   
23/01/03 06:33 PM  
   
   
   
   
   




Almost forgot a "hidden" fact :)

It does not seem Jaxor supports "transparent" persistence - e.g. the beans
need to be somewhat specieal and provide methods for the persistencelayer
to
work...net.sourceforge.jaxor.example.domain.BaseEntityInterface for which
an
example can be found at:
http://jaxor.sourceforge.net/src/net/sourceforge/jaxor/example/domain/BaseEn

tity.java

/max

- Original Message -
From: "Max Rydahl Andersen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 23, 2003 8:29 AM
Subject: Anyone up yet another philosophical comparison :)


> http://jaxor.sourceforge.net/
>
> A persistence layer "backed up" by the all and mighty Martin Fowler :)
>
> Got some nice ideas...but one point made me wonder if Hibernate could do
> same/better/worse!?:
>
> On http://jaxor.sourceforge.net/whyJaxor.htm there is four headlines:
Don't
> Load More Data Than You Have To, Tell Me What Has Changed. Don't Make Me
> Look!, Death to Duplication and Power of Text.
>
> My comments for those blocks are:
>
> Don't Load More Data Than You Have To
>
> Talks about transparent lazy loading and about the "difficulties" of
> handling proxies and special code for this.
> Jaxor solves this by generating the code that handles this (e.g.
generating
> the proxies and the code for it).
> Hibernate have done this "always" and it is event better today (my
opnion):
> It does not need to generate the proxies upfront by the power of cglib
and
> the code for it is inside hibernate (no need for special case
codegeneration
> for this).
> Note: Jaxor seems to make a point of generating code instead of having
> generel reflective codeI see advantages and disadvantages in both.
>
> Tell Me What Has Changed. Don't Make Me Look!
> Here is what it says:"Jaxor, through code generation, has the ability to
> notify the session exactly when, where, and how objects are changed. In
> contrast, frameworks using reflection must register the clean state of
the
> object when it's loaded, then upon committing the session the state of
the
> object is compared against it's original state to see if it has changed.
If
> thousands (or hundreds of thousands) of objects are loaded from the
> database, committing these objects can be slower than necessary due to
the
> equality checks that have to be performed. Also, the state of the object
is
> duplicated in memory, so this may cause memory scalability problems.
Jaxor
> never suffers from these scalability problems. Objects are represented in
> memory once. If they are updated, or deleted, then the session is
notified
> of the changed. No extra comparisons have to be done. "
>
> And here I come short - Can't find what to say in Hibernates defence here
?
> (How much "double state" does Hibernate need ?)
>
> Death to Duplication
> Well - this part is about generating code from metadata instead of manual
> keeping code in sync with metadata. Here Hibernate rock :)
> we got xdocbean2hbm and hbm2java and its constantly improving.
>
> Second part is about having a "Database synchronization tool to match
> mapping information to the database schema" about handling simple
"deltas"
> to a schema and INFORMING about columns/tables that the metadata does NOT
> cover...(maybe we should 

Re: [Hibernate] Anyone up yet another philosophical comparison :)

2003-01-23 Thread Gavin . King



>> Don't Load More Data Than You Have To <<

But hey! thats only half the story! Also: Don't hit the database
more *often* than you have to. So you ALSO need outerjoin fetching
where appropriate!


>> Tell Me What Has Changed. Don't Make Me Look! <<

These arguments go to performance. So where are the performance
numbers to back up these assertions. I have plenty of tests to
show that the overhead of dirtychecking is trivial compared
to the work involved in loading the objects in the first place!

This person has NEVER done any actual profiling. If they DID, they
would know the truth ;)

>> If thousands (or hundreds of thousands) of objects are loaded from the
database, committing these objects can be slower than necessary due to the
equality checks that have to be performed. <<

Ah, can't leave this one alone.

In Hibernate:

session.setFlushMode(FlushMode.NEVER)

will remove the need to do this in a transaction that just reads a
thousand objects. But nobody ever bothers to use this functionality
because it is, in fact, a TRIVIAL overhead compared to loading a
thousand objects off the database in the first place!

>> Also, the state of the object is
duplicated in memory, so this may cause memory scalability problems. <<

LOL!! This person is clueless. To verify this:

(1) Install JProbe
(2) Run Hibernate
(3) check how many objects your JDBC driver instantiates in the
process of retrieving an SQL ResultSet.

>> Jaxor never suffers from these scalability problems. Objects are
represented in
memory once. If they are updated, or deleted, then the session is notified
of the changed. No extra comparisons have to be done.<<

At MOST, the memory consumption of Hibernate could be 2 * Jaxor. But in
fact, including the memory consumed by the JDBC calls, the ratio is much
less than that.

Now, in my book, a CONSTANT factor memory overhead is never a
_scalability_ problem, by definition. Perhaps if you could show that
the overhead increased as the system scaled (which it doesn't), you
could make this argument. Scalability problems in large systems
usually revolve around *concurrency* issues, which Hibernate manages
beautifully.

Once again, I conclude that this author knows very little about the
subject (in this case, scalability).

>> Second part is about having a "Database synchronization tool to match
mapping information to the database schema" about handling simple "deltas"
to a schema and INFORMING about columns/tables that the metadata does NOT
cover...(maybe we should start maturing schemaupdate and build a
schemacomparison "tool" ?) <<

I am sceptical until I see something work in practice. I have never ever
worked on a site where, once a system was in production, the DBA would
let me use my litte auto-schema-updater on the live database. I think this
person lives in a theoretical world where developers manage production
databases ;)

>> Power of Text. <<

I think I said that first, in the Hibernate FAQ.



Was I a little harsh on this guy? Sorry ;)


**
Any personal or sensitive information contained in this email and
attachments must be handled in accordance with the Victorian Information
Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988
(Commonwealth), as applicable.

This email, including all attachments, is confidential.  If you are not the
intended recipient, you must not disclose, distribute, copy or use the
information contained in this email or attachments.  Any confidentiality or
privilege is not waived or lost because this email has been sent to you in
error.  If you have received it in error, please let us know by reply
email, delete it from your system and destroy any copies.
**





---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



Re: [Hibernate] Anyone up yet another philosophical comparison :)

2003-01-23 Thread Gavin . King

I suppose I'm overstating this case a little. I guess it might be
slightly helpful when deploying to a staging server with "live"
data. But I still don't see it really working in practice.

>> I am sceptical until I see something work in practice. I have never ever
worked on a site where, once a system was in production, the DBA would
let me use my litte auto-schema-updater on the live database. I think this
person lives in a theoretical world where developers manage production
databases ;) <<

**
Any personal or sensitive information contained in this email and
attachments must be handled in accordance with the Victorian Information
Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988
(Commonwealth), as applicable.

This email, including all attachments, is confidential.  If you are not the
intended recipient, you must not disclose, distribute, copy or use the
information contained in this email or attachments.  Any confidentiality or
privilege is not waived or lost because this email has been sent to you in
error.  If you have received it in error, please let us know by reply
email, delete it from your system and destroy any copies.
**





---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



[Hibernate] saveOrUpdate()

2003-01-23 Thread Gavin . King
Since I seem to be spending *so* much time with problems relating
to saveOrUpdate() functionality, I decided to provide some new
functionality.

The Hibernate2 interceptor interface now has a

Boolean isUnsaved(Object)

method, so that the application can use something completely
different to unsaved-value, if it wants.


comments?


**
Any personal or sensitive information contained in this email and
attachments must be handled in accordance with the Victorian Information
Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988
(Commonwealth), as applicable.

This email, including all attachments, is confidential.  If you are not the
intended recipient, you must not disclose, distribute, copy or use the
information contained in this email or attachments.  Any confidentiality or
privilege is not waived or lost because this email has been sent to you in
error.  If you have received it in error, please let us know by reply
email, delete it from your system and destroy any copies.
**





---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



[Hibernate] Top level collection but need long transaction

2003-01-23 Thread Toni Charlot
Top level collections are what I thought of using at first but I have a
need for long transactions.  I read in the doc that sess.update(obj) can
not be called on objects with top level collection elements

Person contains a Collection of Address objects
Customer contains a collection of Address objects
Vendor contains only one Address object
Address contains a collection of Phone objects

All three classes would refer to the same table instead of
PERSON_ADDRESS, 
PERSON_ADDRESS_PHONE ,
CUSTOMER_ADDRESS, 
CUSTOMER_ADDRESS_PHONE,
put all the Address fields in the VENDOR table
VENDOR_PHONE.

The database itself does not implement referential integrity for
portability issues, all referential integrity checking will be left to
the application's persistence layer.

Instead of the bunch of tables above the database would contains the
following tables:
PERSON
CUSTOMER
VENDOR
ADDRESS
PHONE

In the mapping file, I'm looking at doing something like the following:
(will if fly?)

Person & Customer  class mappings






-
Vendor class mapping



-
Address class mapping





-
Thank you.





---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



Re: [Hibernate] New Logo

2003-01-23 Thread Gavin . King

Sorry, Christian I've been trying to get onto IRC to talk to you
about a number of things but just SO busy  gr .

Thanks for putting this together!




   
   
Christian Bauer
   
<[EMAIL PROTECTED]>   To: [EMAIL PROTECTED]
 
Sent by:cc:
   
[EMAIL PROTECTED]   Subject: [Hibernate] New Logo  
   
eforge.net 
   
   
   
   
   
23/01/03 02:25 AM  
   
   
   
   
   




Three days since I put the Logo up on the Wiki and no comment yet?

Everyone happy with it? :) So I'll just go ahead and create new
templates for our website...

--
Christian Bauer
[EMAIL PROTECTED]


---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel




**
Any personal or sensitive information contained in this email and
attachments must be handled in accordance with the Victorian Information
Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988
(Commonwealth), as applicable.

This email, including all attachments, is confidential.  If you are not the
intended recipient, you must not disclose, distribute, copy or use the
information contained in this email or attachments.  Any confidentiality or
privilege is not waived or lost because this email has been sent to you in
error.  If you have received it in error, please let us know by reply
email, delete it from your system and destroy any copies.
**





---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



[Hibernate] Using factory methods to obtain new instances

2003-01-23 Thread Gavin King
Yes, I am very open to this; not only for instantiation, but
also for *proxy* instantiation. My motivation for this is
integration with AOP frameworks.

How I propose to do this is to add some more methods to
Interceptor in Hibernate2. (It is currently possible by
extending EntityPersister, but that is Bad.)

So we would add

Object Interceptor.instantiate(Class clazz);

and

Object Interceptor.instantiateProxy(Class clazz, Serializable id,
SessionImplementor s);

or something like that.


>Just a quick query: as I understand it, each Object that uses Hibernate
>or persistence needs to have a concrete class with an empty
>constructor. How hard would it be to modify Hibernate to call a method
>on a factory class instead of "new"? And how hard would it be to be
>able to pass a reference to this factory class to hibernate, to allow
>for non-static methods?

>I ask because I tend to persist objects that act (at their most basic)
>as strongly typed Maps. These can be created on the fly using dynamic
>proxies from a basic interface. The rest should follow from there.





---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



RE: [Hibernate] saveOrUpdate()

2003-01-23 Thread Ara Abrahamian
What about a isModified()? For tracking modification. Is it possible to
add a modification-tracking="true" to a  and let Hibernate
decide whether an object is modified (a setter method actually changed a
property, etc) and then only update that modified object and that
specific field only?

Ara. 

> -Original Message-
> From: [EMAIL PROTECTED]
[mailto:hibernate-devel-
> [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
> Sent: Thursday, January 23, 2003 12:00 PM
> To: [EMAIL PROTECTED]
> Subject: [Hibernate] saveOrUpdate()
> 
> Since I seem to be spending *so* much time with problems relating
> to saveOrUpdate() functionality, I decided to provide some new
> functionality.
> 
> The Hibernate2 interceptor interface now has a
> 
> Boolean isUnsaved(Object)
> 
> method, so that the application can use something completely
> different to unsaved-value, if it wants.
> 
> 
> comments?
> 
> 
> **
> Any personal or sensitive information contained in this email and
> attachments must be handled in accordance with the Victorian
Information
> Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988
> (Commonwealth), as applicable.
> 
> This email, including all attachments, is confidential.  If you are
not
> the
> intended recipient, you must not disclose, distribute, copy or use the
> information contained in this email or attachments.  Any
confidentiality
> or
> privilege is not waived or lost because this email has been sent to
you in
> error.  If you have received it in error, please let us know by reply
> email, delete it from your system and destroy any copies.
> **
> 
> 
> 
> 
> 
> ---
> This SF.net email is sponsored by: Scholarships for Techies!
> Can't afford IT training? All 2003 ictp students receive scholarships.
> Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
> www.ictp.com/training/sourceforge.asp
> ___
> hibernate-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/hibernate-devel



---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



[Hibernate] [ hibernate-Patches-670213 ] Support decode in addition to ANSI-style case

2003-01-23 Thread SourceForge.net
Patches item #670213, was opened at 2003-01-18 20:58
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428710&aid=670213&group_id=40712

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Simon Harris (haruki_zaemon)
Assigned to: Nobody/Anonymous (nobody)
Summary: Support decode in addition to ANSI-style case

Initial Comment:
Updated to allow the use of DECODE when ANSI-style 
case syntax is not supported.

Added 2 methods to dialect.Dialect: supportsAnsiCase 
and supportsDecode which return true and false 
respectively for backwards compatibility.

Overide 2 methods in dialiect.SAPDBDialect: 
supportsAnsiCase and supportsDecode to return false 
and true respectively.

Updated 1 method in persiter.MultiTableEntityPersister: 
propertySelectClauseFragment  to generate decode if 
possible when ANSI-style case is not supported.

--

>Comment By: Simon Harris (haruki_zaemon)
Date: 2003-01-23 00:04

Message:
Logged In: YES 
user_id=146770

Patch for same

--

Comment By: Simon Harris (haruki_zaemon)
Date: 2003-01-22 23:32

Message:
Logged In: YES 
user_id=146770

Updated source files to use the latest H2 structure. I ran my 
own tests and the code works but I notice there is a bug in 
the new HB2 code somewhere using left outer joins. The 
following sql (1:1 association between party and 
membership, party has 2 join-subclasses person and 
company) returns 3 rows when it should only return 1:

Membe1_.id as id0, Membe1_.versionId as versionId0, 
Membe1_.status as status0, Membe1_.expiryDate as 
expiryDate0, Party2_.partyId as partyId1, decode 
(Party2_.partyId, Party2__1.personId, 1, 
Party2__2.companyId, 2, Party2_.partyId, 0 ) as clazz_1, 
Party2_.versionId as versionId0_1, Party2_.addressStreet as 
addressStreet0_1, Party2_.addressCity as addressCity0_1, 
Party2_.addressStateOrProvince as 
addressStateOrProvince0_1, 
Party2_.addressZipOrPostalCode as 
addressZipOrPostalCode0_1, 
Party2_.addressISOCountryCode as 
addressISOCountryCode0_1, 
Party2_.phoneNumberISOCountryCode as 
phoneNumberISOCountryCode0_1, 
Party2_.phoneNumberCityOrAreaCode as 
phoneNumberCityOrAreaCode0_1, 
Party2_.phoneNumberLocalNumber as 
phoneNumberLocalNumber0_1, Party2_.loginName as 
loginName0_1, Party2__1.firstGivenName as 
firstGivenName1_1, Party2__1.lastGivenName as 
lastGivenName1_1, Party2__1.otherNames as 
otherNames1_1, Party2__1.dateOfBirth as dateOfBirth1_1, 
Party2__1.lastGivenNameSoundex as 
lastGivenNameSoundex1_1, Party2__2.companyName as 
companyName2_1, Party2__2.abn as abn2_1, 
Perso0_.partyId as partyId2, Perso0__1.firstGivenName as 
firstGivenName1_2, Perso0__1.lastGivenName as 
lastGivenName1_2, Perso0__1.otherNames as 
otherNames1_2, Perso0__1.dateOfBirth as dateOfBirth1_2, 
Perso0__1.lastGivenNameSoundex as 
lastGivenNameSoundex1_2, Perso0_.versionId as 
versionId0_2, Perso0_.addressStreet as addressStreet0_2, 
Perso0_.addressCity as addressCity0_2, 
Perso0_.addressStateOrProvince as 
addressStateOrProvince0_2, 
Perso0_.addressZipOrPostalCode as 
addressZipOrPostalCode0_2, 
Perso0_.addressISOCountryCode as 
addressISOCountryCode0_2, 
Perso0_.phoneNumberISOCountryCode as 
phoneNumberISOCountryCode0_2, 
Perso0_.phoneNumberCityOrAreaCode as 
phoneNumberCityOrAreaCode0_2, 
Perso0_.phoneNumberLocalNumber as 
phoneNumberLocalNumber0_2, Perso0_.loginName as 
loginName0_2 FROM Party Perso0_, Person Perso0__1, 
Membership Membe1_, Party Party2_, Person Party2__1, 
Company Party2__2 WHERE Perso0_.partyId=? and 
Perso0_.partyId=Membe1_.id(+) and 
Membe1_.id=Party2_.partyId(+) and 
Party2_.partyId=Party2__1.personId(+) and 
Party2_.partyId=Party2__2.companyId(+)

--

Comment By: Simon Harris (haruki_zaemon)
Date: 2003-01-19 10:09

Message:
Logged In: YES 
user_id=146770

Attached both cvs diff and files in whole. Comment on the diff 
is wrong. I wrote for 2 files but actually it is for 3 files.

--

Comment By: Nobody/Anonymous (nobody)
Date: 2003-01-19 09:52

Message:
Logged In: NO 

Unfortunately, your patch never made it into the patch manager!

(No Files Currently Attached)



--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428710&aid=670213&group_id=40712


---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hiber

[Hibernate] [ hibernate-Patches-670213 ] Support decode in addition to ANSI-style case

2003-01-23 Thread SourceForge.net
Patches item #670213, was opened at 2003-01-18 20:58
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428710&aid=670213&group_id=40712

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Simon Harris (haruki_zaemon)
Assigned to: Nobody/Anonymous (nobody)
Summary: Support decode in addition to ANSI-style case

Initial Comment:
Updated to allow the use of DECODE when ANSI-style 
case syntax is not supported.

Added 2 methods to dialect.Dialect: supportsAnsiCase 
and supportsDecode which return true and false 
respectively for backwards compatibility.

Overide 2 methods in dialiect.SAPDBDialect: 
supportsAnsiCase and supportsDecode to return false 
and true respectively.

Updated 1 method in persiter.MultiTableEntityPersister: 
propertySelectClauseFragment  to generate decode if 
possible when ANSI-style case is not supported.

--

>Comment By: Simon Harris (haruki_zaemon)
Date: 2003-01-22 23:32

Message:
Logged In: YES 
user_id=146770

Updated source files to use the latest H2 structure. I ran my 
own tests and the code works but I notice there is a bug in 
the new HB2 code somewhere using left outer joins. The 
following sql (1:1 association between party and 
membership, party has 2 join-subclasses person and 
company) returns 3 rows when it should only return 1:

Membe1_.id as id0, Membe1_.versionId as versionId0, 
Membe1_.status as status0, Membe1_.expiryDate as 
expiryDate0, Party2_.partyId as partyId1, decode 
(Party2_.partyId, Party2__1.personId, 1, 
Party2__2.companyId, 2, Party2_.partyId, 0 ) as clazz_1, 
Party2_.versionId as versionId0_1, Party2_.addressStreet as 
addressStreet0_1, Party2_.addressCity as addressCity0_1, 
Party2_.addressStateOrProvince as 
addressStateOrProvince0_1, 
Party2_.addressZipOrPostalCode as 
addressZipOrPostalCode0_1, 
Party2_.addressISOCountryCode as 
addressISOCountryCode0_1, 
Party2_.phoneNumberISOCountryCode as 
phoneNumberISOCountryCode0_1, 
Party2_.phoneNumberCityOrAreaCode as 
phoneNumberCityOrAreaCode0_1, 
Party2_.phoneNumberLocalNumber as 
phoneNumberLocalNumber0_1, Party2_.loginName as 
loginName0_1, Party2__1.firstGivenName as 
firstGivenName1_1, Party2__1.lastGivenName as 
lastGivenName1_1, Party2__1.otherNames as 
otherNames1_1, Party2__1.dateOfBirth as dateOfBirth1_1, 
Party2__1.lastGivenNameSoundex as 
lastGivenNameSoundex1_1, Party2__2.companyName as 
companyName2_1, Party2__2.abn as abn2_1, 
Perso0_.partyId as partyId2, Perso0__1.firstGivenName as 
firstGivenName1_2, Perso0__1.lastGivenName as 
lastGivenName1_2, Perso0__1.otherNames as 
otherNames1_2, Perso0__1.dateOfBirth as dateOfBirth1_2, 
Perso0__1.lastGivenNameSoundex as 
lastGivenNameSoundex1_2, Perso0_.versionId as 
versionId0_2, Perso0_.addressStreet as addressStreet0_2, 
Perso0_.addressCity as addressCity0_2, 
Perso0_.addressStateOrProvince as 
addressStateOrProvince0_2, 
Perso0_.addressZipOrPostalCode as 
addressZipOrPostalCode0_2, 
Perso0_.addressISOCountryCode as 
addressISOCountryCode0_2, 
Perso0_.phoneNumberISOCountryCode as 
phoneNumberISOCountryCode0_2, 
Perso0_.phoneNumberCityOrAreaCode as 
phoneNumberCityOrAreaCode0_2, 
Perso0_.phoneNumberLocalNumber as 
phoneNumberLocalNumber0_2, Perso0_.loginName as 
loginName0_2 FROM Party Perso0_, Person Perso0__1, 
Membership Membe1_, Party Party2_, Person Party2__1, 
Company Party2__2 WHERE Perso0_.partyId=? and 
Perso0_.partyId=Membe1_.id(+) and 
Membe1_.id=Party2_.partyId(+) and 
Party2_.partyId=Party2__1.personId(+) and 
Party2_.partyId=Party2__2.companyId(+)

--

Comment By: Simon Harris (haruki_zaemon)
Date: 2003-01-19 10:09

Message:
Logged In: YES 
user_id=146770

Attached both cvs diff and files in whole. Comment on the diff 
is wrong. I wrote for 2 files but actually it is for 3 files.

--

Comment By: Nobody/Anonymous (nobody)
Date: 2003-01-19 09:52

Message:
Logged In: NO 

Unfortunately, your patch never made it into the patch manager!

(No Files Currently Attached)



--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428710&aid=670213&group_id=40712


---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



Re: [Hibernate] Top level collection but need long transaction

2003-01-23 Thread Gavin . King

Don't use toplevel collections because we have removed them from 2.0.
(Your use case is correct, however.)




   
   
"Toni Charlot" 
   
<[EMAIL PROTECTED]>  To: <[EMAIL PROTECTED]>   

Sent by:cc:
   
[EMAIL PROTECTED]   Subject: [Hibernate] Top level 
collection but need long transaction   
eforge.net 
   
   
   
   
   
23/01/03 10:19 AM  
   
Please respond to developer
   
   
   
   
   




Top level collections are what I thought of using at first but I have a
need for long transactions.  I read in the doc that sess.update(obj) can
not be called on objects with top level collection elements

Person contains a Collection of Address objects
Customer contains a collection of Address objects
Vendor contains only one Address object
Address contains a collection of Phone objects

All three classes would refer to the same table instead of
PERSON_ADDRESS,
PERSON_ADDRESS_PHONE ,
CUSTOMER_ADDRESS,
CUSTOMER_ADDRESS_PHONE,
put all the Address fields in the VENDOR table
VENDOR_PHONE.

The database itself does not implement referential integrity for
portability issues, all referential integrity checking will be left to
the application's persistence layer.

Instead of the bunch of tables above the database would contains the
following tables:
PERSON
CUSTOMER
VENDOR
ADDRESS
PHONE

In the mapping file, I'm looking at doing something like the following:
(will if fly?)

Person & Customer  class mappings

   




-
Vendor class mapping



-
Address class mapping





-
Thank you.





---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel




**
Any personal or sensitive information contained in this email and
attachments must be handled in accordance with the Victorian Information
Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988
(Commonwealth), as applicable.

This email, including all attachments, is confidential.  If you are not the
intended recipient, you must not disclose, distribute, copy or use the
information contained in this email or attachments.  Any confidentiality or
privilege is not waived or lost because this email has been sent to you in
error.  If you have received it in error, please let us know by reply
email, delete it from your system and destroy any copies.
**





---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



[Hibernate] [ hibernate-Patches-672865 ] Fix for too-long column name aliases

2003-01-23 Thread SourceForge.net
Patches item #672865, was opened at 2003-01-22 17:22
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428710&aid=672865&group_id=40712

Category: None
Group: None
Status: Open
Resolution: None
>Priority: 8
Submitted By: Mark Woon (unkyaku)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fix for too-long column name aliases

Initial Comment:
This is another approach to resolve the problem with
Hibernate generating column aliases that are too long.
 Instead of appending a suffix to the original name,
I've modified it so that it generates unique names. 
The change to handle this was simple enough (in
EntityPersister and MultiTableEntityPersister), but it
took a long time to figure out why loading
joined-subclasses didn't work too well.  That required
the change to Loader.

In any case, I hope this patch works out better than
the last one. Gavin, I really need a solution to this
problem since this is my only remaining problem with
Hibernate.


--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428710&aid=672865&group_id=40712


---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



[Hibernate] [ hibernate-Bugs-672639 ] HB2 generating incorrect join query

2003-01-23 Thread SourceForge.net
Bugs item #672639, was opened at 2003-01-23 06:08
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428708&aid=672639&group_id=40712

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Simon Harris (haruki_zaemon)
Assigned to: Nobody/Anonymous (nobody)
Summary: HB2 generating incorrect join query

Initial Comment:
I have the following classes:

Party 1:1 Membership

Party joined-sub-classes Person, Company

When executing a query to find a Person, the following 
two sql statements are executed:

SELECT Membe1_.id as id0, Membe1_.versionId as 
versionId0, Perso0_.partyId as partyId1, 
Perso0_.versionId as versionId0_1, Perso0_.loginName 
as loginName0_1 FROM Party Perso0_, Person 
Perso0__1, Membership Membe1_ WHERE 
Perso0_.partyId=? and Perso0_.partyId=Membe1_.id(+)

followed by:

SELECT Membe0_.id as id, Membe0_.versionId as 
versionId FROM Membership Membe0_ WHERE 
Membe0_.id=?

Firslty, I'm not quite sure why the second query is 
generated at all but more importantly, you will notice the 
addition of an extra table in the FROM clause of the first 
query:

Person Perso0__1

Which is not needed and causes multiple results to be 
returned.

I noticed this when I submitted some patches for the 
decode stuff. I realise hb2 is still beta but I wanted to 
document it anyway. I'll look into this problem and see 
what I can find unless someone else has a slap the 
forehead DOH! moment and realises what is going 
wrong first :-)

Cheers,

Simon

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428708&aid=672639&group_id=40712


---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



[Hibernate] [ hibernate-Patches-672865 ] Fix for too-long column name aliases

2003-01-23 Thread SourceForge.net
Patches item #672865, was opened at 2003-01-22 17:22
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428710&aid=672865&group_id=40712

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Mark Woon (unkyaku)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fix for too-long column name aliases

Initial Comment:
This is another approach to resolve the problem with
Hibernate generating column aliases that are too long.
 Instead of appending a suffix to the original name,
I've modified it so that it generates unique names. 
The change to handle this was simple enough (in
EntityPersister and MultiTableEntityPersister), but it
took a long time to figure out why loading
joined-subclasses didn't work too well.  That required
the change to Loader.

In any case, I hope this patch works out better than
the last one. Gavin, I really need a solution to this
problem since this is my only remaining problem with
Hibernate.


--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428710&aid=672865&group_id=40712


---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



[Hibernate] any successful story with hibernate?

2003-01-23 Thread jiesheng zhang
Hi, guys
I am currently designing a Java project. I'd like to
use a Object relational mapping tool to manage the
persistnece layer. My friend suggests hibernate for
me.  Other people also warns me about the capability
of Object relation mapping solution. This makes me
worry about the hibernate capability.
I have two questions?
First is there a real example commercial application
which used hibernate?
What is the difference between object bridge hosted by
Apache and hibernate?

Thanks

jason
 

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com


---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



Re: [Hibernate] Anyone up yet another philosophical comparison :)

2003-01-23 Thread Max Rydahl Andersen
> > Was I a little harsh on this guy? Sorry ;)
>
> Just got your last point, cos it's only fair to point out that if this
> is a Martin Fowler backed project, the chances are that this has been
> developed in an "Extreme" manner, and probably has the easy support of
> extreme programming in mind as one of the (unstated) aims of the code.
> As a result, yes, he does live in a theoretical world where developers
> manage ... databases. :)

Just to be sure I ain't misunderstanding this

Do you mean that is an theoritical world where developers manage databases ?
(Because then i'm quite sure I live in a theoritical world, because Im a
developer and I do manage database (and many of my co-developers does it
to - simply to keep the db and programs world in its best shape and sync)

/max




---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



Re: [Hibernate] saveOrUpdate()

2003-01-23 Thread Gavin . King

Its perfectly possible to let the object decide with this new
functionality;
just define an interface with an isPersistent() method thats implemented
by the persistent classes. Let the interceptor call that method, if the
passed object implements the interface, otherwise return null and
Hibernate will use the old mechanism.




   

"Max Rydahl

Andersen"To: <[EMAIL PROTECTED]>,  

<[EMAIL PROTECTED]>  <[EMAIL PROTECTED]>   
   
 cc:   

23/01/03 07:43   Subject: Re: [Hibernate] saveOrUpdate()   

PM 

   

   





> Since I seem to be spending *so* much time with problems relating
> to saveOrUpdate() functionality, I decided to provide some new
> functionality.
>
> The Hibernate2 interceptor interface now has a
>
> Boolean isUnsaved(Object)
>
> method, so that the application can use something completely
> different to unsaved-value, if it wants.
>
>
> comments?

APPLAUSE!:)

I like it :), but how about an complementray functionallity
that allows one to use any property to mark the object as unsaved ?
(unsaved is not use for dirty checks, right ?)

Why would I want this ? I want it because then this critical information is
possible to state in the metadata file and not
in some externally semi-related object as the interceptor. (I still like
the
idea about being able to have the Interceptor have a say on the
matter...maybe have an isUnsaved(Object, objectsOwnAnswer)  which the
interceptor could thus "veto"?!?)

I imagine this stuff to be similar to to  tag, so


  
..


Which would let the object provide an isUnsaved() method - (which might or
might not be an persistent property)
Thus this should be allowed:



  
..
  


(and maybe similar for using it as an id, but here one should maybe just
use
the current unsaved semantics..?)

/max











**
Any personal or sensitive information contained in this email and
attachments must be handled in accordance with the Victorian Information
Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988
(Commonwealth), as applicable.

This email, including all attachments, is confidential.  If you are not the
intended recipient, you must not disclose, distribute, copy or use the
information contained in this email or attachments.  Any confidentiality or
privilege is not waived or lost because this email has been sent to you in
error.  If you have received it in error, please let us know by reply
email, delete it from your system and destroy any copies.
**





---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



Re: [Hibernate] saveOrUpdate()

2003-01-23 Thread Max Rydahl Andersen
> Since I seem to be spending *so* much time with problems relating
> to saveOrUpdate() functionality, I decided to provide some new
> functionality.
>
> The Hibernate2 interceptor interface now has a
>
> Boolean isUnsaved(Object)
>
> method, so that the application can use something completely
> different to unsaved-value, if it wants.
>
>
> comments?

APPLAUSE!:)

I like it :), but how about an complementray functionallity
that allows one to use any property to mark the object as unsaved ?
(unsaved is not use for dirty checks, right ?)

Why would I want this ? I want it because then this critical information is
possible to state in the metadata file and not
in some externally semi-related object as the interceptor. (I still like the
idea about being able to have the Interceptor have a say on the
matter...maybe have an isUnsaved(Object, objectsOwnAnswer)  which the
interceptor could thus "veto"?!?)

I imagine this stuff to be similar to to  tag, so


  
..


Which would let the object provide an isUnsaved() method - (which might or
might not be an persistent property)
Thus this should be allowed:



  
..
  


(and maybe similar for using it as an id, but here one should maybe just use
the current unsaved semantics..?)

/max









---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



[Hibernate] RE: composite-id still doesn't work for me...

2003-01-23 Thread Matt Raible
So is it possible to get a parent w/ children and only make a call to
update(parent)?  From your e-mail below, I gathered that I could change
my storeObject() method to use update() rather than saveOrUpdate() and
everything would work peachy-keen.  Nope, I still get the same error -
so obviously this is not the case.

But from the FAQ (http://hibernate.bluemars.net/14.html#10), it seems to
imply that I need to loop through all the children, doing update(child)
and then do an update(parent).  If I do this, I'd think that I would
need to remove the children from the parent before calling
update(parent).  

I don't mind doing it this way - I just want to make sure I'm following
"best practices" for parent-child relationships with composite-ids.

Thanks,

Matt

In reply to:
http://sourceforge.net/mailarchive/forum.php?thread_id=1557661&forum_id=
7517

 Of course!
 
 Its a FAQ item that assigned ids including composite ids can't
distinguish
 between a
 saved or unsaved object (you have a choice between "always update" or
 "always insert").
 
 So if you want to add a new child (with unsaved-value="none"), simply
save
 () it
 manually first:
 
 child.setParent(parent);
 parent.addChild(child);
 session.save(child);
 session.update(parent);
 
 None of these things are issues if you use synthetic ids, as is best
 practice for all
 sorts of other reasons (see Scott Ambler's paper).




---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



[Hibernate] Re: Anyone up yet another philosophical comparison :)

2003-01-23 Thread Gavin King
>> Was I a little harsh on this guy? Sorry ;)

> Just got your last point, cos it's only fair to point out that if this
> is a Martin Fowler backed project, the chances are that this has been
> developed in an "Extreme" manner, and probably has the easy support of
> extreme programming in mind as one of the (unstated) aims of the code.
> As a result, yes, he does live in a theoretical world where developers
> manage ... databases. :)

h well, maybe its just the kind of systems I've worked with. I
would love to be able to control the live database, but most often
I wouldn't even be able to log into the production server, let alone
change its schema without the input of a DBA. (But I have worked with
systems that push money around, so my experience may be atypical.)

So perhaps I should take a look at Jaxor's schema evolution tool,
perhaps it is *much* more sophisticated than SchemaUpdate. But I'm
still sceptical. Theres only so much automagic schema evolution
that you could possibly do with live data.

> Were you a little harsh? I'm not the judge of that.

Of course I was too harsh. But I take a dim view of performance
arguments made a priori. If one of the selling features of your product
is that its dirty checking technique is much faster than systems that
do dirty checking on commit, I want to see numbers to demonstrate this
fact, not weak arguments like those above. Because of what I know about
the performance of Hibernate and OJB (which both do dirty checking on
commit), relative to the performance of direct JDBC, I know that he
won't be able to provide these numbers.


Anyway, I'll switch out of polemic mode right now, because I know its
unbecoming (too many chocolate frogs earlier, I think).





---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



RE: [Hibernate] saveOrUpdate()

2003-01-23 Thread Gavin . King

Yes, I'm glad you raised this Ara, there are a couple of different
things I've been speculating about here:

(1) An isDirty() interceptor callback, to allow an application to
implement its own dirty checking algorithm
(2) A new property attribute; update="never|auto", to declare
"readonly" properties that are updated outside the application
(by a trigger, for example).
(3) A new property attribute; dirty-check="always|never" to allow
a property that isn't itself dirty-checked, but *is* updated
if other properties are dirty. (I am kinda ripping off a feature
of Castor here ;)
(4) Reintroduce dynamically generated SQL UPDATEs (which only
update dirty columns), as an option. I implemented this feature
at one stage, but the performance gains were not what you would
expect in my tests. However, it is worth having as an option.

Now, I'm not sure which of these features are good or which we
should actually add (all? some? none?) For example, (2) and (4)
seem to address similar problems, in slightly different ways.

None of these features is at all difficult to implement in the
current codebase (all are very straightforward, actually) and I
even already implemented one of them and then threw it away

Now, people shouldn't get too excited, the performance gains to be
had by these techniques are a lot less than you might expect,
a-priori. But I can see that in certain special cases, each would
be handy to have

comments?

Gavin



   
   
"Ara Abrahamian"   
   
<[EMAIL PROTECTED]> To: <[EMAIL 
PROTECTED]>   
Sent by:cc:
   
[EMAIL PROTECTED]   Subject: RE: [Hibernate] 
saveOrUpdate()   
eforge.net 
   
   
   
   
   
24/01/03 06:59 AM  
   
   
   
   
   




What about a isModified()? For tracking modification. Is it possible to
add a modification-tracking="true" to a  and let Hibernate
decide whether an object is modified (a setter method actually changed a
property, etc) and then only update that modified object and that
specific field only?

Ara.

> -Original Message-
> From: [EMAIL PROTECTED]
[mailto:hibernate-devel-
> [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
> Sent: Thursday, January 23, 2003 12:00 PM
> To: [EMAIL PROTECTED]
> Subject: [Hibernate] saveOrUpdate()
>
> Since I seem to be spending *so* much time with problems relating
> to saveOrUpdate() functionality, I decided to provide some new
> functionality.
>
> The Hibernate2 interceptor interface now has a
>
> Boolean isUnsaved(Object)
>
> method, so that the application can use something completely
> different to unsaved-value, if it wants.
>
>
> comments?
>
>
> **
> Any personal or sensitive information contained in this email and
> attachments must be handled in accordance with the Victorian
Information
> Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988
> (Commonwealth), as applicable.
>
> This email, including all attachments, is confidential.  If you are
not
> the
> intended recipient, you must not disclose, distribute, copy or use the
> information contained in this email or attachments.  Any
confidentiality
> or
> privilege is not waived or lost because this email has been sent to
you in
> error.  If you have received it in error, please let us know by reply
> email, delete it from your system and destroy any copies.
> **
>
>
>
>
>
> ---
> This SF.net email is sponsored by: Scholarships for Techies!
> Can't afford IT training? All 2003 ictp students receive scholarships.
> Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
> www.ictp.com/training/sourceforg

[Hibernate] Re: Anyone up yet another philosophical comparison :)

2003-01-23 Thread Max Rydahl Andersen
Almost forgot a "hidden" fact :)

It does not seem Jaxor supports "transparent" persistence - e.g. the beans
need to be somewhat specieal and provide methods for the persistencelayer to
work...net.sourceforge.jaxor.example.domain.BaseEntityInterface for which an
example can be found at:
http://jaxor.sourceforge.net/src/net/sourceforge/jaxor/example/domain/BaseEn
tity.java

/max

- Original Message -
From: "Max Rydahl Andersen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 23, 2003 8:29 AM
Subject: Anyone up yet another philosophical comparison :)


> http://jaxor.sourceforge.net/
>
> A persistence layer "backed up" by the all and mighty Martin Fowler :)
>
> Got some nice ideas...but one point made me wonder if Hibernate could do
> same/better/worse!?:
>
> On http://jaxor.sourceforge.net/whyJaxor.htm there is four headlines:
Don't
> Load More Data Than You Have To, Tell Me What Has Changed. Don't Make Me
> Look!, Death to Duplication and Power of Text.
>
> My comments for those blocks are:
>
> Don't Load More Data Than You Have To
>
> Talks about transparent lazy loading and about the "difficulties" of
> handling proxies and special code for this.
> Jaxor solves this by generating the code that handles this (e.g.
generating
> the proxies and the code for it).
> Hibernate have done this "always" and it is event better today (my
opnion):
> It does not need to generate the proxies upfront by the power of cglib and
> the code for it is inside hibernate (no need for special case
codegeneration
> for this).
> Note: Jaxor seems to make a point of generating code instead of having
> generel reflective codeI see advantages and disadvantages in both.
>
> Tell Me What Has Changed. Don't Make Me Look!
> Here is what it says:"Jaxor, through code generation, has the ability to
> notify the session exactly when, where, and how objects are changed. In
> contrast, frameworks using reflection must register the clean state of the
> object when it's loaded, then upon committing the session the state of the
> object is compared against it's original state to see if it has changed.
If
> thousands (or hundreds of thousands) of objects are loaded from the
> database, committing these objects can be slower than necessary due to the
> equality checks that have to be performed. Also, the state of the object
is
> duplicated in memory, so this may cause memory scalability problems. Jaxor
> never suffers from these scalability problems. Objects are represented in
> memory once. If they are updated, or deleted, then the session is notified
> of the changed. No extra comparisons have to be done. "
>
> And here I come short - Can't find what to say in Hibernates defence here
?
> (How much "double state" does Hibernate need ?)
>
> Death to Duplication
> Well - this part is about generating code from metadata instead of manual
> keeping code in sync with metadata. Here Hibernate rock :)
> we got xdocbean2hbm and hbm2java and its constantly improving.
>
> Second part is about having a "Database synchronization tool to match
> mapping information to the database schema" about handling simple "deltas"
> to a schema and INFORMING about columns/tables that the metadata does NOT
> cover...(maybe we should start maturing schemaupdate and build a
> schemacomparison "tool" ?)
>
> Power of Text.
> "Gui's are often wonderful marketing tools, but awful development tools" -
> nuff said :) (and he continues " Even worse are gui's that don't work
> directly with text files" :)
> "If you are implementing a non-trivial (is there any other kind?)
> application, and someone attempts to sell you an O/R mapping tool that
> doesn't allow you to configure the mapping information with your favorite
> text editor, run away. "... well, here Hibernate is all about text :)
>
> Any comments  ? :)
>
> /max
>



---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



Re: [Hibernate] New appreach for alias names

2003-01-23 Thread Gavin . King

Mark, thanks for the patch - but would you please submit this to the
patch manager? I havn't been able to find time to review this, and I
don't want it to get lost in the list

sorry about that..

TIA

Gavin




   
   
Mark Woon  
   
<[EMAIL PROTECTED]> To: Hibernate Mailing List <[EMAIL 
PROTECTED]>
Sent by:cc:
   
[EMAIL PROTECTED]   Subject: [Hibernate] New appreach for 
alias names 
eforge.net 
   
   
   
   
   
22/01/03 01:10 AM  
   
   
   
   
   





I've come up with another approach to resolve the problem with Hibernate
generating column aliases that are too long.  Instead of appending a
suffix to the original name, I've modified it so that it generates
unique names.  The change to handle this was simple enough (in
EntityPersister and MultiTableEntityPersister), but it took a long time
to figure out why loading joined-subclasses didn't work too well.  That
required the change to Loader.

In any case, I hope this patch works out better than the last one.
 Gavin, I really need a solution to this problem since this is my only
remaining problem with Hibernate.

-Mark

Index: cirrus/hibernate/loader/Loader.java
===
RCS file:
/cvsroot/hibernate/Hibernate/cirrus/hibernate/loader/Loader.java,v
retrieving revision 1.34
diff -c -b -r1.34 Loader.java
*** cirrus/hibernate/loader/Loader.java15 Jan 2003 12:52:40 -
  1.34
--- cirrus/hibernate/loader/Loader.java21 Jan 2003 13:35:14 -
***
*** 164,170 

  // grab its
state from the ResultSet and keep it in the Session
  // (but don't
yet initialize the object itself)
!
loadFromResultSet( rs, row[i], keys[i].getIdentifier(), suffixes[i],
session );

  if
(twoPhaseLoad) {

//materialize associations (and initialize the object) later
--- 164,170 

  // grab its
state from the ResultSet and keep it in the Session
  // (but don't
yet initialize the object itself)
!
loadFromResultSet( rs, persisters[i], row[i], keys[i].getIdentifier(),
suffixes[i], session );

  if
(twoPhaseLoad) {

//materialize associations (and initialize the object) later
***
*** 316,331 

   }

-
   /**
* Hydrate an object from the SQL ResultSet
*/
!  private void loadFromResultSet(ResultSet rs, Object object,
Serializable id, String suffix, SessionImplementor session) throws
SQLException, HibernateException {

 if ( log.isTraceEnabled() ) log.trace("Initializing
object from ResultSet: " + id);

 // Get the persister for the _subclass_
!Loadable persister = (Loadable)
session.getPersister(object);

 Object[] values = hydrate(rs, id, object, persister,
session, suffix);
 session.postHydrate(persister, id, values, object,
getLockMode() );
--- 316,332 

   }

/**
 * Hydrate an object from the SQL ResultSet
 */
!   private void loadFromResultSet(ResultSet rs, Loadable persister, Object
object, Serializable id, String suffix, SessionImplementor session)
! throws SQLException, HibernateException {

  if ( log.isTraceEnabled() ) log.trace("Initializing object from
ResultSet: " + id);

  // Get the persister for the _subclass_
! // Why?  In any case, can't do this with new column aliases
! //Loadable persister = (Loadable) session.getPersister(object);

  

[Hibernate] State of the Hibernate2 codebase?

2003-01-23 Thread Schnitzer, Jeff
I was wondering, how usable is the Hibernate2 codebase right now?
Obviously I'm not looking to rush it into production, but I have a
project that would be a suitable guinea pig if Hib2 compiles and
(mostly) works...

Thanks,
Jeff


---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel