Re: NullPointerException in many-many relationship cross two models

2009-12-15 Thread David Avendasora

On Dec 15, 2009, at 6:55 AM, Kieran Kelleher wrote:

> Chuck, you are mean! ;-)
> 
> Ren, here is connection URL example:
> 
> jdbc:mysql://myhost/mydatabase?capitalizeTypenames=true&useUnicode=true&characterEncoding=UTF-8
> 
> Also, changing the my.cnf will not magically change databases and tables that 
> have been previously created without UTF-8.
> 
> 
> See the CREATE DATABASE and CREATE TABLE statement docs online. YOu can 
> verify a table's current encoding with SHOW CREATE TABLE. I *think* you can 
> even have different encodings on different columns if you really want to 
> . that of course if the versatility of the wonderful MySQL. The reference 
> manual is generally comprehensive
> http://dev.mysql.com/doc/refman/5.0/en/
> http://dev.mysql.com/doc/refman/5.0/en/charset.html
> 
> HTH, Kieran

Whew. Good thing MySQL is so simple. :-P

Dave

> 
> On Dec 14, 2009, at 10:59 PM, Chuck Hill wrote:
> 
>> For WebObjects and Java, UTF-8.  Not sure what MySquirrelyDatabase needs.
>> 
>> 
>> 
>> 
>> On Dec 14, 2009, at 7:51 PM, Ren, Kevin wrote:
>> 
>>> 
>>> yes, this confused me. In my.cnf default-character-set=utf8
>>> 
>>> I did google search someone said  characterEncoding=UTF8 working, others 
>>> said characterEncoding=UTF-8.
>>> 
>>> Not sure which one is right?
>>> 
>>> 
>>> Kevin
>>> 
>>>> -Original Message-
>>>> From: Chuck Hill [mailto:ch...@global-village.net]
>>>> Sent: Tuesday, 15 December 2009 4:42 p.m.
>>>> To: Ran, Kevin
>>>> Cc: webobjects-dev@lists.apple.com
>>>> Subject: Re: NullPointerException in many-many relationship
>>>> cross two models
>>>> 
>>>> 
>>>> On Dec 14, 2009, at 7:37 PM, Ren, Kevin wrote:
>>>> 
>>>>> 
>>>>> Hi,
>>>>> 
>>>>> You are brilliant, guys. It's simple copy/past error in the URL.
>>>>> 
>>>>> jdbc:mysql://156.13.128.28:3306/school?
>>>>> useUnicode=true&characterEncoding=UTF8
>>>>> 
>>>>> One was using characterEncoding=UTF-8 instead of UTF8, causing this
>>>>> problem.
>>>>> 
>>>>> Now I change them both to UTF8 and works,
>>>> 
>>>> 
>>>> UTF-8 is the correct form
>>>> 
>>>> 
>>>> Chuck
>>>> 
>>>> 
>>>>>> -Original Message-
>>>>>> From:
>>>>>> webobjects-dev-bounces+kevin.ren=anz@lists.apple.com
>>>>>> [mailto:webobjects-dev-bounces+kevin.ren=anz@lists.apple.c
>>>>>> om] On Behalf Of Mike Schrag
>>>>>> Sent: Tuesday, 15 December 2009 4:25 p.m.
>>>>>> To: Development WebObjects
>>>>>> Subject: Re: NullPointerException in many-many
>>>> relationship cross two
>>>>>> models
>>>>>> 
>>>>>> same connection dictionary like "i think they're the same
>>>> because the
>>>>>> url is the same" or same like "i tested with
>>>>>> .equals(..) at runtime and it returns true thereby proving they're
>>>>>> the same" (technically they don't have to be exactly
>>>> .equals, but if
>>>>>> they are .equals, they are same-enough)
>>>>>> 
>>>>>> On Dec 14, 2009, at 10:22 PM, Ren, Kevin wrote:
>>>>>> 
>>>>>>> 
>>>>>>> HI,
>>>>>>> 
>>>>>>> I checked that, they are same connection dictionary,
>>>>>> because this just moral test example.
>>>>>>> 
>>>>>>> Not using WOnder,
>>>>>>> 
>>>>>>> Thanks
>>>>>>> 
>>>>>>> Kevin
>>>>>>> 
>>>>>>>> -Original Message-
>>>>>>>> From: Chuck Hill [mailto:ch...@global-village.net]
>>>>>>>> Sent: Tuesday, 15 December 2009 4:18 p.m.
>>>>>>>> To: Ren, Kevin
>>>>>>>> Cc: webobjects-dev@lists.apple.com
>>>>>>>> Subject: Re: NullPointerException in many-many
>>>>>> relationship cross two
>>>>>>>> models
>>>>>>>> 
>>>>>>>

Re: NullPointerException in many-many relationship cross two models

2009-12-15 Thread Kieran Kelleher

Chuck, you are mean! ;-)

Ren, here is connection URL example:

jdbc:mysql://myhost/mydatabase? 
capitalizeTypenames=true&useUnicode=true&characterEncoding=UTF-8


Also, changing the my.cnf will not magically change databases and  
tables that have been previously created without UTF-8.



See the CREATE DATABASE and CREATE TABLE statement docs online. YOu  
can verify a table's current encoding with SHOW CREATE TABLE. I  
*think* you can even have different encodings on different columns if  
you really want to . that of course if the versatility of the  
wonderful MySQL. The reference manual is generally comprehensive

http://dev.mysql.com/doc/refman/5.0/en/
http://dev.mysql.com/doc/refman/5.0/en/charset.html

HTH, Kieran

On Dec 14, 2009, at 10:59 PM, Chuck Hill wrote:

For WebObjects and Java, UTF-8.  Not sure what MySquirrelyDatabase  
needs.





On Dec 14, 2009, at 7:51 PM, Ren, Kevin wrote:



yes, this confused me. In my.cnf default-character-set=utf8

I did google search someone said  characterEncoding=UTF8 working,  
others said characterEncoding=UTF-8.


Not sure which one is right?


Kevin


-Original Message-
From: Chuck Hill [mailto:ch...@global-village.net]
Sent: Tuesday, 15 December 2009 4:42 p.m.
To: Ran, Kevin
Cc: webobjects-dev@lists.apple.com
Subject: Re: NullPointerException in many-many relationship
cross two models


On Dec 14, 2009, at 7:37 PM, Ren, Kevin wrote:



Hi,

You are brilliant, guys. It's simple copy/past error in the URL.

jdbc:mysql://156.13.128.28:3306/school?
useUnicode=true&characterEncoding=UTF8

One was using characterEncoding=UTF-8 instead of UTF8, causing this
problem.

Now I change them both to UTF8 and works,



UTF-8 is the correct form


Chuck



-Original Message-
From:
webobjects-dev-bounces+kevin.ren=anz@lists.apple.com
[mailto:webobjects-dev-bounces+kevin.ren=anz@lists.apple.c
om] On Behalf Of Mike Schrag
Sent: Tuesday, 15 December 2009 4:25 p.m.
To: Development WebObjects
Subject: Re: NullPointerException in many-many

relationship cross two

models

same connection dictionary like "i think they're the same

because the

url is the same" or same like "i tested with
.equals(..) at runtime and it returns true thereby proving they're
the same" (technically they don't have to be exactly

.equals, but if

they are .equals, they are same-enough)

On Dec 14, 2009, at 10:22 PM, Ren, Kevin wrote:



HI,

I checked that, they are same connection dictionary,

because this just moral test example.


Not using WOnder,

Thanks

Kevin


-Original Message-
From: Chuck Hill [mailto:ch...@global-village.net]
Sent: Tuesday, 15 December 2009 4:18 p.m.
To: Ren, Kevin
Cc: webobjects-dev@lists.apple.com
Subject: Re: NullPointerException in many-many

relationship cross two

models

Both models need to have the exact (and I _do_ mean

_exact_) same

connection dictionary.  The dictionaries must be equals().

This is

most easily accomplished by setting the programatically

when the app

loads.  Wonder, of course, does this.


Chuck


On Dec 14, 2009, at 3:30 PM, Ren, Kevin wrote:

Hi,

There is m-m relationship between A and B entities which are in
different models, but in same database. I can create and

platen this

relationship in EOModler and got AB table as well.

AB is in the same DB and only has compound PK like A_ID

and B_ID.


When I tried to do saveChanges got this error


[2009-12-15 12:6:48 NZDT] 
java.lang.NullPointerException
at
com
.webobjects
.eoaccess
.EODatabaseContext





.primaryKeyForIntermediateRowFromSourceObject 
(EODatabaseContext.java:

4845)

at
com
.webobjects
.eoaccess
.EODatabaseContext
.databaseOperationForIntermediateRowFromSourceObject
(EODatabaseContext.java:4863)

at
com
.webobjects
.eoaccess
.EODatabaseContext
.recordInsertForIntermediateRowFromSourceObject
(EODatabaseContext.java:4888)

at
com
.webobjects
.eoaccess
.EODatabaseContext
.relayAttributesInRelationshipSourceObjectDestinationObject
(EODatabaseContext.java:4913)

at
com
.webobjects
.eoaccess
.EODatabaseContext
.relayAttributesInRelationshipSourceObjectDestinationObjects
(EODatabaseContext.java:4966)

at
com
.webobjects
.eoaccess
.EODatabaseContext
.recordChangesInEditingContext(EODatabaseContext.java:6036)
at
com
.webobjects
.eocontrol
.EOObjectStoreCoordinator
.saveChangesInEditingContext(EOObjectStoreCoordinator.java:373)

at
com
.webobjects

.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java: 
3192)



And I found only updateObjects could has two entities's

details and

insertedObjects does not print out anything.

Not sure this does not work in across models or something

else need

setup?

thanks



Xiaowen(Kevin) Ren

Analyst Programmer
Channel Applications, Retail Applications ANZ National Bank

Ltd Level

6 ASB Tower
2 Hunter Street
PO Box 1791
Wellington
Phone: 04 4365363
Fax: 04 8028696





"This e-mail and any at

Re: NullPointerException in many-many relationship cross two models

2009-12-14 Thread Cheong Hee (Gmail)

Thought it is unsolved yet.  Pls ignore.

- Original Message - 
From: "Cheong Hee (Gmail)" 

To: "Ren, Kevin" ; 
Sent: Tuesday, December 15, 2009 12:26 PM
Subject: Re: NullPointerException in many-many relationship cross two models



Hi Kevin

Could you post your code over how object inserted and saved?

Cheers

Cheong Hee



___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NullPointerException in many-many relationship cross two models

2009-12-14 Thread Cheong Hee (Gmail)

Hi Kevin

Could you post your code over how object inserted and saved?

Cheers

Cheong Hee

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


RE: NullPointerException in many-many relationship cross two models

2009-12-14 Thread Ren, Kevin
Cool, thanks

Kevin 

> -Original Message-
> From: Chuck Hill [mailto:ch...@global-village.net] 
> Sent: Tuesday, 15 December 2009 5:00 p.m.
> To: Ren, Kevin
> Cc: webobjects-dev@lists.apple.com
> Subject: Re: NullPointerException in many-many relationship 
> cross two models
> 
> For WebObjects and Java, UTF-8.  Not sure what 
> MySquirrelyDatabase needs.
> 
> 
> 
> 
> On Dec 14, 2009, at 7:51 PM, Ren, Kevin wrote:
> 
> >
> > yes, this confused me. In my.cnf default-character-set=utf8
> >
> > I did google search someone said  characterEncoding=UTF8 working, 
> > others said characterEncoding=UTF-8.
> >
> > Not sure which one is right?
> >
> >
> > Kevin
> >
> >> -Original Message-
> >> From: Chuck Hill [mailto:ch...@global-village.net]
> >> Sent: Tuesday, 15 December 2009 4:42 p.m.
> >> To: Ran, Kevin
> >> Cc: webobjects-dev@lists.apple.com
> >> Subject: Re: NullPointerException in many-many 
> relationship cross two 
> >> models
> >>
> >>
> >> On Dec 14, 2009, at 7:37 PM, Ren, Kevin wrote:
> >>
> >>>
> >>> Hi,
> >>>
> >>> You are brilliant, guys. It's simple copy/past error in the URL.
> >>>
> >>> jdbc:mysql://156.13.128.28:3306/school?
> >>> useUnicode=true&characterEncoding=UTF8
> >>>
> >>> One was using characterEncoding=UTF-8 instead of UTF8, 
> causing this 
> >>> problem.
> >>>
> >>> Now I change them both to UTF8 and works,
> >>
> >>
> >> UTF-8 is the correct form
> >>
> >>
> >> Chuck
> >>
> >>
> >>>> -Original Message-
> >>>> From:
> >>>> webobjects-dev-bounces+kevin.ren=anz@lists.apple.com
> >>>> [mailto:webobjects-dev-bounces+kevin.ren=anz@lists.apple.c
> >>>> om] On Behalf Of Mike Schrag
> >>>> Sent: Tuesday, 15 December 2009 4:25 p.m.
> >>>> To: Development WebObjects
> >>>> Subject: Re: NullPointerException in many-many
> >> relationship cross two
> >>>> models
> >>>>
> >>>> same connection dictionary like "i think they're the same
> >> because the
> >>>> url is the same" or same like "i tested with
> >>>> .equals(..) at runtime and it returns true thereby 
> proving they're 
> >>>> the same" (technically they don't have to be exactly
> >> .equals, but if
> >>>> they are .equals, they are same-enough)
> >>>>
> >>>> On Dec 14, 2009, at 10:22 PM, Ren, Kevin wrote:
> >>>>
> >>>>>
> >>>>> HI,
> >>>>>
> >>>>> I checked that, they are same connection dictionary,
> >>>> because this just moral test example.
> >>>>>
> >>>>> Not using WOnder,
> >>>>>
> >>>>> Thanks
> >>>>>
> >>>>> Kevin
> >>>>>
> >>>>>> -Original Message-
> >>>>>> From: Chuck Hill [mailto:ch...@global-village.net]
> >>>>>> Sent: Tuesday, 15 December 2009 4:18 p.m.
> >>>>>> To: Ren, Kevin
> >>>>>> Cc: webobjects-dev@lists.apple.com
> >>>>>> Subject: Re: NullPointerException in many-many
> >>>> relationship cross two
> >>>>>> models
> >>>>>>
> >>>>>> Both models need to have the exact (and I _do_ mean
> >> _exact_) same
> >>>>>> connection dictionary.  The dictionaries must be equals().
> >>>> This is
> >>>>>> most easily accomplished by setting the programatically
> >>>> when the app
> >>>>>> loads.  Wonder, of course, does this.
> >>>>>>
> >>>>>>
> >>>>>> Chuck
> >>>>>>
> >>>>>>
> >>>>>> On Dec 14, 2009, at 3:30 PM, Ren, Kevin wrote:
> >>>>>>> Hi,
> >>>>>>>
> >>>>>>> There is m-m relationship between A and B entities 
> which are in 
> >>>>>>> different models, but in same database. I can create and
> >>>>>> platen this
> >>>>>>> relationship in E

Re: NullPointerException in many-many relationship cross two models

2009-12-14 Thread Chuck Hill
For WebObjects and Java, UTF-8.  Not sure what MySquirrelyDatabase  
needs.





On Dec 14, 2009, at 7:51 PM, Ren, Kevin wrote:



yes, this confused me. In my.cnf default-character-set=utf8

I did google search someone said  characterEncoding=UTF8 working,  
others said characterEncoding=UTF-8.


Not sure which one is right?


Kevin


-Original Message-
From: Chuck Hill [mailto:ch...@global-village.net]
Sent: Tuesday, 15 December 2009 4:42 p.m.
To: Ran, Kevin
Cc: webobjects-dev@lists.apple.com
Subject: Re: NullPointerException in many-many relationship
cross two models


On Dec 14, 2009, at 7:37 PM, Ren, Kevin wrote:



Hi,

You are brilliant, guys. It's simple copy/past error in the URL.

jdbc:mysql://156.13.128.28:3306/school?
useUnicode=true&characterEncoding=UTF8

One was using characterEncoding=UTF-8 instead of UTF8, causing this
problem.

Now I change them both to UTF8 and works,



UTF-8 is the correct form


Chuck



-Original Message-
From:
webobjects-dev-bounces+kevin.ren=anz@lists.apple.com
[mailto:webobjects-dev-bounces+kevin.ren=anz@lists.apple.c
om] On Behalf Of Mike Schrag
Sent: Tuesday, 15 December 2009 4:25 p.m.
To: Development WebObjects
Subject: Re: NullPointerException in many-many

relationship cross two

models

same connection dictionary like "i think they're the same

because the

url is the same" or same like "i tested with
.equals(..) at runtime and it returns true thereby proving they're
the same" (technically they don't have to be exactly

.equals, but if

they are .equals, they are same-enough)

On Dec 14, 2009, at 10:22 PM, Ren, Kevin wrote:



HI,

I checked that, they are same connection dictionary,

because this just moral test example.


Not using WOnder,

Thanks

Kevin


-Original Message-
From: Chuck Hill [mailto:ch...@global-village.net]
Sent: Tuesday, 15 December 2009 4:18 p.m.
To: Ren, Kevin
Cc: webobjects-dev@lists.apple.com
Subject: Re: NullPointerException in many-many

relationship cross two

models

Both models need to have the exact (and I _do_ mean

_exact_) same

connection dictionary.  The dictionaries must be equals().

This is

most easily accomplished by setting the programatically

when the app

loads.  Wonder, of course, does this.


Chuck


On Dec 14, 2009, at 3:30 PM, Ren, Kevin wrote:

Hi,

There is m-m relationship between A and B entities which are in
different models, but in same database. I can create and

platen this

relationship in EOModler and got AB table as well.

AB is in the same DB and only has compound PK like A_ID

and B_ID.


When I tried to do saveChanges got this error


[2009-12-15 12:6:48 NZDT] 
java.lang.NullPointerException
 at
com
.webobjects
.eoaccess
.EODatabaseContext






.primaryKeyForIntermediateRowFromSourceObject(EODatabaseContext.java:

4845)

 at
com
.webobjects
.eoaccess
.EODatabaseContext
.databaseOperationForIntermediateRowFromSourceObject
(EODatabaseContext.java:4863)

 at
com
.webobjects
.eoaccess
.EODatabaseContext
.recordInsertForIntermediateRowFromSourceObject
(EODatabaseContext.java:4888)

 at
com
.webobjects
.eoaccess
.EODatabaseContext
.relayAttributesInRelationshipSourceObjectDestinationObject
(EODatabaseContext.java:4913)

 at
com
.webobjects
.eoaccess
.EODatabaseContext
.relayAttributesInRelationshipSourceObjectDestinationObjects
(EODatabaseContext.java:4966)

 at
com
.webobjects
.eoaccess
.EODatabaseContext
.recordChangesInEditingContext(EODatabaseContext.java:6036)
 at
com
.webobjects
.eocontrol
.EOObjectStoreCoordinator
.saveChangesInEditingContext(EOObjectStoreCoordinator.java:373)

 at
com
.webobjects


.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192)



And I found only updateObjects could has two entities's

details and

insertedObjects does not print out anything.

Not sure this does not work in across models or something

else need

setup?

thanks



Xiaowen(Kevin) Ren

Analyst Programmer
Channel Applications, Retail Applications ANZ National Bank

Ltd Level

6 ASB Tower
2 Hunter Street
PO Box 1791
Wellington
Phone: 04 4365363
Fax: 04 8028696





"This e-mail and any attachments to it (the

"Communication") is,

unless otherwise stated, confidential,  may contain

copyright material

and is for the use only of the intended recipient. If you

receive the

Communication in error, please notify the sender

immediately by return

e-mail, delete the Communication and the return e-mail,

and do not

read, copy, retransmit or otherwise deal with it. Any views

expressed

in the Communication are those of the individual sender

only, unless

expressly stated to be those of Australia and New

Zealand Banking

Group Limited ABN 11 005 357 522, or any of its related

entities

including ANZ National Bank Limited (together "ANZ"). ANZ

does not

accept liability in connection with the integrity of or

errors in the

Communication, computer virus, 

RE: NullPointerException in many-many relationship cross two models

2009-12-14 Thread Ren, Kevin

 yes, this confused me. In my.cnf default-character-set=utf8

I did google search someone said  characterEncoding=UTF8 working, others said 
characterEncoding=UTF-8.

Not sure which one is right?


Kevin

> -Original Message-
> From: Chuck Hill [mailto:ch...@global-village.net] 
> Sent: Tuesday, 15 December 2009 4:42 p.m.
> To: Ran, Kevin
> Cc: webobjects-dev@lists.apple.com
> Subject: Re: NullPointerException in many-many relationship 
> cross two models
> 
> 
> On Dec 14, 2009, at 7:37 PM, Ren, Kevin wrote:
> 
> >
> > Hi,
> >
> > You are brilliant, guys. It's simple copy/past error in the URL.
> >
> > jdbc:mysql://156.13.128.28:3306/school? 
> > useUnicode=true&characterEncoding=UTF8
> >
> > One was using characterEncoding=UTF-8 instead of UTF8, causing this 
> > problem.
> >
> > Now I change them both to UTF8 and works,
> 
> 
> UTF-8 is the correct form
> 
> 
> Chuck
> 
> 
> >> -Original Message-
> >> From:
> >> webobjects-dev-bounces+kevin.ren=anz@lists.apple.com
> >> [mailto:webobjects-dev-bounces+kevin.ren=anz@lists.apple.c
> >> om] On Behalf Of Mike Schrag
> >> Sent: Tuesday, 15 December 2009 4:25 p.m.
> >> To: Development WebObjects
> >> Subject: Re: NullPointerException in many-many 
> relationship cross two 
> >> models
> >>
> >> same connection dictionary like "i think they're the same 
> because the 
> >> url is the same" or same like "i tested with
> >> .equals(..) at runtime and it returns true thereby proving they're 
> >> the same" (technically they don't have to be exactly 
> .equals, but if 
> >> they are .equals, they are same-enough)
> >>
> >> On Dec 14, 2009, at 10:22 PM, Ren, Kevin wrote:
> >>
> >>>
> >>> HI,
> >>>
> >>> I checked that, they are same connection dictionary,
> >> because this just moral test example.
> >>>
> >>> Not using WOnder,
> >>>
> >>> Thanks
> >>>
> >>> Kevin
> >>>
> >>>> -Original Message-
> >>>> From: Chuck Hill [mailto:ch...@global-village.net]
> >>>> Sent: Tuesday, 15 December 2009 4:18 p.m.
> >>>> To: Ren, Kevin
> >>>> Cc: webobjects-dev@lists.apple.com
> >>>> Subject: Re: NullPointerException in many-many
> >> relationship cross two
> >>>> models
> >>>>
> >>>> Both models need to have the exact (and I _do_ mean 
> _exact_) same 
> >>>> connection dictionary.  The dictionaries must be equals().
> >> This is
> >>>> most easily accomplished by setting the programatically
> >> when the app
> >>>> loads.  Wonder, of course, does this.
> >>>>
> >>>>
> >>>> Chuck
> >>>>
> >>>>
> >>>> On Dec 14, 2009, at 3:30 PM, Ren, Kevin wrote:
> >>>>> Hi,
> >>>>>
> >>>>> There is m-m relationship between A and B entities which are in 
> >>>>> different models, but in same database. I can create and
> >>>> platen this
> >>>>> relationship in EOModler and got AB table as well.
> >>>>>
> >>>>> AB is in the same DB and only has compound PK like A_ID 
> and B_ID.
> >>>>>
> >>>>> When I tried to do saveChanges got this error
> >>>>>
> >>>>>
> >>>>> [2009-12-15 12:6:48 NZDT]  
> >>>>> java.lang.NullPointerException
> >>>>>   at
> >>>>> com
> >>>>> .webobjects
> >>>>> .eoaccess
> >>>>> .EODatabaseContext
> >>>>>
> >>>>
> >> 
> .primaryKeyForIntermediateRowFromSourceObject(EODatabaseContext.java:
> >>>>> 4845)
> >>>>>
> >>>>>   at
> >>>>> com
> >>>>> .webobjects
> >>>>> .eoaccess
> >>>>> .EODatabaseContext
> >>>>> .databaseOperationForIntermediateRowFromSourceObject
> >>>>> (EODatabaseContext.java:4863)
> >>>>>
> >>>>>   at
> >>>>> com
> >>>>> .webobjects
> >>>>> .eoaccess
> >>>>> .EODatabaseContext
> >>>>> .r

Re: NullPointerException in many-many relationship cross two models

2009-12-14 Thread Chuck Hill


On Dec 14, 2009, at 7:37 PM, Ren, Kevin wrote:



Hi,

You are brilliant, guys. It's simple copy/past error in the URL.

jdbc:mysql://156.13.128.28:3306/school? 
useUnicode=true&characterEncoding=UTF8


One was using characterEncoding=UTF-8 instead of UTF8, causing this  
problem.


Now I change them both to UTF8 and works,



UTF-8 is the correct form


Chuck



-Original Message-
From:
webobjects-dev-bounces+kevin.ren=anz@lists.apple.com
[mailto:webobjects-dev-bounces+kevin.ren=anz@lists.apple.c
om] On Behalf Of Mike Schrag
Sent: Tuesday, 15 December 2009 4:25 p.m.
To: Development WebObjects
Subject: Re: NullPointerException in many-many relationship
cross two models

same connection dictionary like "i think they're the same
because the url is the same" or same like "i tested with
.equals(..) at runtime and it returns true thereby proving
they're the same" (technically they don't have to be exactly
.equals, but if they are .equals, they are same-enough)

On Dec 14, 2009, at 10:22 PM, Ren, Kevin wrote:



HI,

I checked that, they are same connection dictionary,

because this just moral test example.


Not using WOnder,

Thanks

Kevin


-Original Message-
From: Chuck Hill [mailto:ch...@global-village.net]
Sent: Tuesday, 15 December 2009 4:18 p.m.
To: Ren, Kevin
Cc: webobjects-dev@lists.apple.com
Subject: Re: NullPointerException in many-many

relationship cross two

models

Both models need to have the exact (and I _do_ mean _exact_) same
connection dictionary.  The dictionaries must be equals().

This is

most easily accomplished by setting the programatically

when the app

loads.  Wonder, of course, does this.


Chuck


On Dec 14, 2009, at 3:30 PM, Ren, Kevin wrote:

Hi,

There is m-m relationship between A and B entities which are in
different models, but in same database. I can create and

platen this

relationship in EOModler and got AB table as well.

AB is in the same DB and only has compound PK like A_ID and B_ID.

When I tried to do saveChanges got this error


[2009-12-15 12:6:48 NZDT] 
java.lang.NullPointerException
  at
com
.webobjects
.eoaccess
.EODatabaseContext




.primaryKeyForIntermediateRowFromSourceObject(EODatabaseContext.java:

4845)

  at
com
.webobjects
.eoaccess
.EODatabaseContext
.databaseOperationForIntermediateRowFromSourceObject
(EODatabaseContext.java:4863)

  at
com
.webobjects
.eoaccess
.EODatabaseContext
.recordInsertForIntermediateRowFromSourceObject
(EODatabaseContext.java:4888)

  at
com
.webobjects
.eoaccess
.EODatabaseContext
.relayAttributesInRelationshipSourceObjectDestinationObject
(EODatabaseContext.java:4913)

  at
com
.webobjects
.eoaccess
.EODatabaseContext
.relayAttributesInRelationshipSourceObjectDestinationObjects
(EODatabaseContext.java:4966)

  at
com
.webobjects
.eoaccess
.EODatabaseContext
.recordChangesInEditingContext(EODatabaseContext.java:6036)
  at
com
.webobjects
.eocontrol
.EOObjectStoreCoordinator
.saveChangesInEditingContext(EOObjectStoreCoordinator.java:373)

  at
com
.webobjects


.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192)



And I found only updateObjects could has two entities's

details and

insertedObjects does not print out anything.

Not sure this does not work in across models or something

else need

setup?

thanks



Xiaowen(Kevin) Ren

Analyst Programmer
Channel Applications, Retail Applications ANZ National Bank

Ltd Level

6 ASB Tower
2 Hunter Street
PO Box 1791
Wellington
Phone: 04 4365363
Fax: 04 8028696





"This e-mail and any attachments to it (the "Communication") is,
unless otherwise stated, confidential,  may contain

copyright material

and is for the use only of the intended recipient. If you

receive the

Communication in error, please notify the sender

immediately by return

e-mail, delete the Communication and the return e-mail,

and do not

read, copy, retransmit or otherwise deal with it. Any views

expressed

in the Communication are those of the individual sender

only, unless

expressly stated to be those of Australia and New Zealand Banking
Group Limited ABN 11 005 357 522, or any of its related entities
including ANZ National Bank Limited (together "ANZ"). ANZ

does not

accept liability in connection with the integrity of or

errors in the

Communication, computer virus, data corruption,

interference or delay

arising from or in respect of the Communication."

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:




http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-

v

illage.net

This email sent to ch...@global-village.net


--
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their
overa

RE: NullPointerException in many-many relationship cross two models

2009-12-14 Thread Ren, Kevin

 Hi,

You are brilliant, guys. It's simple copy/past error in the URL.

jdbc:mysql://156.13.128.28:3306/school?useUnicode=true&characterEncoding=UTF8

One was using characterEncoding=UTF-8 instead of UTF8, causing this problem.

Now I change them both to UTF8 and works, 

Thanks,


kevin


> -Original Message-
> From: 
> webobjects-dev-bounces+kevin.ren=anz@lists.apple.com 
> [mailto:webobjects-dev-bounces+kevin.ren=anz@lists.apple.c
> om] On Behalf Of Mike Schrag
> Sent: Tuesday, 15 December 2009 4:25 p.m.
> To: Development WebObjects
> Subject: Re: NullPointerException in many-many relationship 
> cross two models
> 
> same connection dictionary like "i think they're the same 
> because the url is the same" or same like "i tested with 
> .equals(..) at runtime and it returns true thereby proving 
> they're the same" (technically they don't have to be exactly 
> .equals, but if they are .equals, they are same-enough)
> 
> On Dec 14, 2009, at 10:22 PM, Ren, Kevin wrote:
> 
> > 
> > HI,
> > 
> > I checked that, they are same connection dictionary, 
> because this just moral test example.
> > 
> > Not using WOnder,
> > 
> > Thanks
> > 
> > Kevin
> > 
> >> -Original Message-
> >> From: Chuck Hill [mailto:ch...@global-village.net]
> >> Sent: Tuesday, 15 December 2009 4:18 p.m.
> >> To: Ren, Kevin
> >> Cc: webobjects-dev@lists.apple.com
> >> Subject: Re: NullPointerException in many-many 
> relationship cross two 
> >> models
> >> 
> >> Both models need to have the exact (and I _do_ mean _exact_) same 
> >> connection dictionary.  The dictionaries must be equals(). 
>  This is 
> >> most easily accomplished by setting the programatically 
> when the app 
> >> loads.  Wonder, of course, does this.
> >> 
> >> 
> >> Chuck
> >> 
> >> 
> >> On Dec 14, 2009, at 3:30 PM, Ren, Kevin wrote:
> >>> Hi,
> >>> 
> >>> There is m-m relationship between A and B entities which are in 
> >>> different models, but in same database. I can create and
> >> platen this
> >>> relationship in EOModler and got AB table as well.
> >>> 
> >>> AB is in the same DB and only has compound PK like A_ID and B_ID.
> >>> 
> >>> When I tried to do saveChanges got this error
> >>> 
> >>> 
> >>> [2009-12-15 12:6:48 NZDT]  
> >>> java.lang.NullPointerException
> >>>at
> >>> com
> >>> .webobjects
> >>> .eoaccess
> >>> .EODatabaseContext
> >>> 
> >> 
> .primaryKeyForIntermediateRowFromSourceObject(EODatabaseContext.java: 
> >>> 4845)
> >>> 
> >>>at
> >>> com
> >>> .webobjects
> >>> .eoaccess
> >>> .EODatabaseContext
> >>> .databaseOperationForIntermediateRowFromSourceObject
> >>> (EODatabaseContext.java:4863)
> >>> 
> >>>at
> >>> com
> >>> .webobjects
> >>> .eoaccess
> >>> .EODatabaseContext
> >>> .recordInsertForIntermediateRowFromSourceObject
> >>> (EODatabaseContext.java:4888)
> >>> 
> >>>at
> >>> com
> >>> .webobjects
> >>> .eoaccess
> >>> .EODatabaseContext
> >>> .relayAttributesInRelationshipSourceObjectDestinationObject
> >>> (EODatabaseContext.java:4913)
> >>> 
> >>>at
> >>> com
> >>> .webobjects
> >>> .eoaccess
> >>> .EODatabaseContext
> >>> .relayAttributesInRelationshipSourceObjectDestinationObjects
> >>> (EODatabaseContext.java:4966)
> >>> 
> >>>at
> >>> com
> >>> .webobjects
> >>> .eoaccess
> >>> .EODatabaseContext
> >>> .recordChangesInEditingContext(EODatabaseContext.java:6036)
> >>>at
> >>> com
> >>> .webobjects
> >>> .eocontrol
> >>> .EOObjectStoreCoordinator
> >>> .saveChangesInEditingContext(EOObjectStoreCoordinator.java:373)
> >>> 
> >>>at
> >>> com
> >>> .webobjects
> >>> 
> .eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192)
> >>> 
> >>> 
> >>> And I found only updateObjects could has two entities's 
> de

Re: NullPointerException in many-many relationship cross two models

2009-12-14 Thread Guido Neitzer
On 14. Dec. 2009, at 19:22 , Ren, Kevin wrote:

> I checked that, they are same connection dictionary, because this just moral 
> test example.

You need to check them programmatically. As Chuck said - equals() needs to 
return true.

Guido

-- 
http://www.event-s.net

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NullPointerException in many-many relationship cross two models

2009-12-14 Thread Mike Schrag
same connection dictionary like "i think they're the same because the url is 
the same" or same like "i tested with .equals(..) at runtime and it returns 
true thereby proving they're the same" (technically they don't have to be 
exactly .equals, but if they are .equals, they are same-enough)

On Dec 14, 2009, at 10:22 PM, Ren, Kevin wrote:

> 
> HI,
> 
> I checked that, they are same connection dictionary, because this just moral 
> test example.
> 
> Not using WOnder,
> 
> Thanks
> 
> Kevin
> 
>> -Original Message-
>> From: Chuck Hill [mailto:ch...@global-village.net] 
>> Sent: Tuesday, 15 December 2009 4:18 p.m.
>> To: Ren, Kevin
>> Cc: webobjects-dev@lists.apple.com
>> Subject: Re: NullPointerException in many-many relationship 
>> cross two models
>> 
>> Both models need to have the exact (and I _do_ mean _exact_) 
>> same connection dictionary.  The dictionaries must be 
>> equals().  This is most easily accomplished by setting the 
>> programatically when the app loads.  Wonder, of course, does this.
>> 
>> 
>> Chuck
>> 
>> 
>> On Dec 14, 2009, at 3:30 PM, Ren, Kevin wrote:
>>> Hi,
>>> 
>>> There is m-m relationship between A and B entities which are in 
>>> different models, but in same database. I can create and 
>> platen this 
>>> relationship in EOModler and got AB table as well.
>>> 
>>> AB is in the same DB and only has compound PK like A_ID and B_ID.
>>> 
>>> When I tried to do saveChanges got this error
>>> 
>>> 
>>> [2009-12-15 12:6:48 NZDT]  
>>> java.lang.NullPointerException
>>>at
>>> com
>>> .webobjects
>>> .eoaccess
>>> .EODatabaseContext
>>> 
>> .primaryKeyForIntermediateRowFromSourceObject(EODatabaseContext.java: 
>>> 4845)
>>> 
>>>at
>>> com
>>> .webobjects
>>> .eoaccess
>>> .EODatabaseContext
>>> .databaseOperationForIntermediateRowFromSourceObject
>>> (EODatabaseContext.java:4863)
>>> 
>>>at
>>> com
>>> .webobjects
>>> .eoaccess
>>> .EODatabaseContext
>>> .recordInsertForIntermediateRowFromSourceObject
>>> (EODatabaseContext.java:4888)
>>> 
>>>at
>>> com
>>> .webobjects
>>> .eoaccess
>>> .EODatabaseContext
>>> .relayAttributesInRelationshipSourceObjectDestinationObject
>>> (EODatabaseContext.java:4913)
>>> 
>>>at
>>> com
>>> .webobjects
>>> .eoaccess
>>> .EODatabaseContext
>>> .relayAttributesInRelationshipSourceObjectDestinationObjects
>>> (EODatabaseContext.java:4966)
>>> 
>>>at
>>> com
>>> .webobjects
>>> .eoaccess
>>> .EODatabaseContext
>>> .recordChangesInEditingContext(EODatabaseContext.java:6036)
>>>at
>>> com
>>> .webobjects
>>> .eocontrol
>>> .EOObjectStoreCoordinator
>>> .saveChangesInEditingContext(EOObjectStoreCoordinator.java:373)
>>> 
>>>at
>>> com
>>> .webobjects
>>> .eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192)
>>> 
>>> 
>>> And I found only updateObjects could has two entities's details and 
>>> insertedObjects does not print out anything.
>>> 
>>> Not sure this does not work in across models or something else need 
>>> setup?
>>> 
>>> thanks
>>> 
>>> 
>>> 
>>> Xiaowen(Kevin) Ren
>>> 
>>> Analyst Programmer
>>> Channel Applications, Retail Applications ANZ National Bank 
>> Ltd Level 
>>> 6 ASB Tower
>>> 2 Hunter Street
>>> PO Box 1791
>>> Wellington
>>> Phone: 04 4365363
>>> Fax: 04 8028696
>>> 
>>> 
>>> 
>>> 
>>> 
>>> "This e-mail and any attachments to it (the "Communication") is, 
>>> unless otherwise stated, confidential,  may contain 
>> copyright material 
>>> and is for the use only of the intended recipient. If you 
>> receive the 
>>> Communication in error, please notify the sender 
>> immediately by return 
>>> e-mail, delete the Communication and the return e-mail, and do not 
>>> read, copy, retransmit or otherwise deal with it. Any views 
>> expressed 
>>> i

RE: NullPointerException in many-many relationship cross two models

2009-12-14 Thread Ren, Kevin

 HI,

I checked that, they are same connection dictionary, because this just moral 
test example.

Not using WOnder,

Thanks

Kevin

> -Original Message-
> From: Chuck Hill [mailto:ch...@global-village.net] 
> Sent: Tuesday, 15 December 2009 4:18 p.m.
> To: Ren, Kevin
> Cc: webobjects-dev@lists.apple.com
> Subject: Re: NullPointerException in many-many relationship 
> cross two models
> 
> Both models need to have the exact (and I _do_ mean _exact_) 
> same connection dictionary.  The dictionaries must be 
> equals().  This is most easily accomplished by setting the 
> programatically when the app loads.  Wonder, of course, does this.
> 
> 
> Chuck
> 
> 
> On Dec 14, 2009, at 3:30 PM, Ren, Kevin wrote:
> > Hi,
> >
> > There is m-m relationship between A and B entities which are in 
> > different models, but in same database. I can create and 
> platen this 
> > relationship in EOModler and got AB table as well.
> >
> > AB is in the same DB and only has compound PK like A_ID and B_ID.
> >
> > When I tried to do saveChanges got this error
> >
> >
> > [2009-12-15 12:6:48 NZDT]  
> > java.lang.NullPointerException
> > at
> > com
> > .webobjects
> > .eoaccess
> > .EODatabaseContext
> > 
> .primaryKeyForIntermediateRowFromSourceObject(EODatabaseContext.java: 
> > 4845)
> >
> > at
> > com
> > .webobjects
> > .eoaccess
> > .EODatabaseContext
> > .databaseOperationForIntermediateRowFromSourceObject
> > (EODatabaseContext.java:4863)
> >
> > at
> > com
> > .webobjects
> > .eoaccess
> > .EODatabaseContext
> > .recordInsertForIntermediateRowFromSourceObject
> > (EODatabaseContext.java:4888)
> >
> > at
> > com
> > .webobjects
> > .eoaccess
> > .EODatabaseContext
> > .relayAttributesInRelationshipSourceObjectDestinationObject
> > (EODatabaseContext.java:4913)
> >
> > at
> > com
> > .webobjects
> > .eoaccess
> > .EODatabaseContext
> > .relayAttributesInRelationshipSourceObjectDestinationObjects
> > (EODatabaseContext.java:4966)
> >
> > at
> > com
> > .webobjects
> > .eoaccess
> > .EODatabaseContext
> > .recordChangesInEditingContext(EODatabaseContext.java:6036)
> > at
> > com
> > .webobjects
> > .eocontrol
> > .EOObjectStoreCoordinator
> > .saveChangesInEditingContext(EOObjectStoreCoordinator.java:373)
> >
> > at
> > com
> > .webobjects
> > .eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192)
> >
> >
> > And I found only updateObjects could has two entities's details and 
> > insertedObjects does not print out anything.
> >
> > Not sure this does not work in across models or something else need 
> > setup?
> >
> > thanks
> >
> >
> >
> > Xiaowen(Kevin) Ren
> >
> > Analyst Programmer
> > Channel Applications, Retail Applications ANZ National Bank 
> Ltd Level 
> > 6 ASB Tower
> > 2 Hunter Street
> > PO Box 1791
> > Wellington
> > Phone: 04 4365363
> > Fax: 04 8028696
> >
> >
> >
> >
> >
> > "This e-mail and any attachments to it (the "Communication") is, 
> > unless otherwise stated, confidential,  may contain 
> copyright material 
> > and is for the use only of the intended recipient. If you 
> receive the 
> > Communication in error, please notify the sender 
> immediately by return 
> > e-mail, delete the Communication and the return e-mail, and do not 
> > read, copy, retransmit or otherwise deal with it. Any views 
> expressed 
> > in the Communication are those of the individual sender 
> only, unless 
> > expressly stated to be those of Australia and New Zealand Banking 
> > Group Limited ABN 11 005 357 522, or any of its related entities 
> > including ANZ National Bank Limited (together "ANZ"). ANZ does not 
> > accept liability in connection with the integrity of or 
> errors in the 
> > Communication, computer virus, data corruption, 
> interference or delay 
> > arising from or in respect of the Communication."
> >
> > ___
> > Do not post admin requests to the list. They will be ignored.
> > Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> > Help/Unsubscribe/Update your Subscription:
> > 
> http://lists.apple.com/mailman/options/webobjects-dev/chil

Re: NullPointerException in many-many relationship cross two models

2009-12-14 Thread Chuck Hill
Both models need to have the exact (and I _do_ mean _exact_) same  
connection dictionary.  The dictionaries must be equals().  This is  
most easily accomplished by setting the programatically when the app  
loads.  Wonder, of course, does this.



Chuck


On Dec 14, 2009, at 3:30 PM, Ren, Kevin wrote:

Hi,

There is m-m relationship between A and B entities which are in  
different models, but in same database. I can create and platen this  
relationship in EOModler and got AB table as well.


AB is in the same DB and only has compound PK like A_ID and B_ID.

When I tried to do saveChanges got this error


[2009-12-15 12:6:48 NZDT]   
java.lang.NullPointerException
at  
com 
.webobjects 
.eoaccess 
.EODatabaseContext 
.primaryKeyForIntermediateRowFromSourceObject(EODatabaseContext.java: 
4845)


at  
com 
.webobjects 
.eoaccess 
.EODatabaseContext 
.databaseOperationForIntermediateRowFromSourceObject 
(EODatabaseContext.java:4863)


at  
com 
.webobjects 
.eoaccess 
.EODatabaseContext 
.recordInsertForIntermediateRowFromSourceObject 
(EODatabaseContext.java:4888)


at  
com 
.webobjects 
.eoaccess 
.EODatabaseContext 
.relayAttributesInRelationshipSourceObjectDestinationObject 
(EODatabaseContext.java:4913)


at  
com 
.webobjects 
.eoaccess 
.EODatabaseContext 
.relayAttributesInRelationshipSourceObjectDestinationObjects 
(EODatabaseContext.java:4966)


at  
com 
.webobjects 
.eoaccess 
.EODatabaseContext 
.recordChangesInEditingContext(EODatabaseContext.java:6036)
at  
com 
.webobjects 
.eocontrol 
.EOObjectStoreCoordinator 
.saveChangesInEditingContext(EOObjectStoreCoordinator.java:373)


at  
com 
.webobjects 
.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192)



And I found only updateObjects could has two entities's details and  
insertedObjects does not print out anything.


Not sure this does not work in across models or something else need  
setup?


thanks



Xiaowen(Kevin) Ren

Analyst Programmer
Channel Applications, Retail Applications
ANZ National Bank Ltd
Level 6 ASB Tower
2 Hunter Street
PO Box 1791
Wellington
Phone: 04 4365363
Fax: 04 8028696





"This e-mail and any attachments to it (the "Communication") is,  
unless otherwise stated, confidential,  may contain copyright  
material and is for the use only of the intended recipient. If you  
receive the Communication in error, please notify the sender  
immediately by return e-mail, delete the Communication and the  
return e-mail, and do not read, copy, retransmit or otherwise deal  
with it. Any views expressed in the Communication are those of the  
individual sender only, unless expressly stated to be those of  
Australia and New Zealand Banking Group Limited ABN 11 005 357 522,  
or any of its related entities including ANZ National Bank Limited  
(together "ANZ"). ANZ does not accept liability in connection with  
the integrity of or errors in the Communication, computer virus,  
data corruption, interference or delay arising from or in respect of  
the Communication."


___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net

This email sent to ch...@global-village.net


--
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their  
overall knowledge of WebObjects or who are trying to solve specific  
problems.

http://www.global-village.net/products/practical_webobjects







___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com