Users - PostalAddress with Foreign Country State

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Users - PostalAddress with Foreign Country State

Vinay Agarwal

Hello,

 

If I create a postal address, using XML import datasource, with STATE_PROVINCE_GEO_ID set to a foreign country state (“UP”), I get the following error

ERROR: Error parsing entity xml file: org.ofbiz.entity.GenericEntityException: Exception while updating the following entity: [GenericEntity:PostalAddress][contactMechId,CompAddrIndia(java.lang.String)][lastUpdatedStamp,2006-03-20 08:28:35.906(java.sql.Timestamp)][lastUpdatedTxStamp,2006-03-20 08:28:35.859(java.sql.Timestamp)][stateProvinceGeoId,UP(java.lang.String)] (while updating: [GenericEntity:PostalAddress][contactMechId,CompAddrIndia(java.lang.String)][lastUpdatedStamp,2006-03-20 08:28:35.906(java.sql.Timestamp)][lastUpdatedTxStamp,2006-03-20 08:28:35.859(java.sql.Timestamp)][stateProvinceGeoId,UP(java.lang.String)] (SQL Exception while executing the following:UPDATE POSTAL_ADDRESS SET STATE_PROVINCE_GEO_ID=?, LAST_UPDATED_TX_STAMP=?, LAST_UPDATED_STAMP=? WHERE CONTACT_MECH_ID=? (Cannot add or update a child row: a foreign key constraint fails (`ofbiz/postal_address`, CONSTRAINT `POST_ADDR_SPGEO` FOREIGN KEY (`STATE_PROVINCE_GEO_ID`) REFERENCES `geo` (`GEO_ID`)))))

 

The error definitely relates to “UP” since it works OK if I just change it to “CA”. Is this an error in xml import or is this the way it is supposed to work?

 

Thanks in advance,

Vinay Agarwal


 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - PostalAddress with Foreign Country State

Jacopo Cappellato
Hi Viany,

you probably just have to add a record in the Geo entity for the UP state.

Jacopo

Vinay Agarwal wrote:

> Hello,
>
>  
>
> If I create a postal address, using XML import datasource, with
> STATE_PROVINCE_GEO_ID set to a foreign country state (“UP”), I get the
> following error
>
> ERROR: Error parsing entity xml file:
> org.ofbiz.entity.GenericEntityException: Exception while updating the
> following entity:
> [GenericEntity:PostalAddress][contactMechId,CompAddrIndia(java.lang.String)][lastUpdatedStamp,2006-03-20
> 08:28:35.906(java.sql.Timestamp)][lastUpdatedTxStamp,2006-03-20
> 08:28:35.859(java.sql.Timestamp)][stateProvinceGeoId,UP(java.lang.String)]
> (while updating:
> [GenericEntity:PostalAddress][contactMechId,CompAddrIndia(java.lang.String)][lastUpdatedStamp,2006-03-20
> 08:28:35.906(java.sql.Timestamp)][lastUpdatedTxStamp,2006-03-20
> 08:28:35.859(java.sql.Timestamp)][stateProvinceGeoId,UP(java.lang.String)]
> (SQL Exception while executing the following:UPDATE POSTAL_ADDRESS SET
> STATE_PROVINCE_GEO_ID=?, LAST_UPDATED_TX_STAMP=?, LAST_UPDATED_STAMP=?
> WHERE CONTACT_MECH_ID=? (Cannot add or update a child row: a foreign key
> constraint fails (`ofbiz/postal_address`, CONSTRAINT `POST_ADDR_SPGEO`
> FOREIGN KEY (`STATE_PROVINCE_GEO_ID`) REFERENCES `geo` (`GEO_ID`)))))
>
>  
>
> The error definitely relates to “UP” since it works OK if I just change
> it to “CA”. Is this an error in xml import or is this the way it is
> supposed to work?
>
>  
>
> Thanks in advance,
>
> Vinay Agarwal
>
>
> ------------------------------------------------------------------------
>
>  
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/users

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - PostalAddress with Foreign Country State

Vinay Agarwal
Jacopo,

I guessed that but isn't it too restrictive that anyone whose state isn't
included in the database won't be able to enter his state id?

Vinay

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
On Behalf Of Jacopo Cappellato
Sent: Monday, March 20, 2006 8:45 AM
To: OFBiz Users / Usage Discussion
Subject: Re: [OFBiz] Users - PostalAddress with Foreign Country State

Hi Viany,

you probably just have to add a record in the Geo entity for the UP state.

Jacopo

Vinay Agarwal wrote:

> Hello,
>
>  
>
> If I create a postal address, using XML import datasource, with
> STATE_PROVINCE_GEO_ID set to a foreign country state ("UP"), I get the
> following error
>
> ERROR: Error parsing entity xml file:
> org.ofbiz.entity.GenericEntityException: Exception while updating the
> following entity:
>
[GenericEntity:PostalAddress][contactMechId,CompAddrIndia(java.lang.String)]
[lastUpdatedStamp,2006-03-20
> 08:28:35.906(java.sql.Timestamp)][lastUpdatedTxStamp,2006-03-20
> 08:28:35.859(java.sql.Timestamp)][stateProvinceGeoId,UP(java.lang.String)]

> (while updating:
>
[GenericEntity:PostalAddress][contactMechId,CompAddrIndia(java.lang.String)]
[lastUpdatedStamp,2006-03-20
> 08:28:35.906(java.sql.Timestamp)][lastUpdatedTxStamp,2006-03-20
> 08:28:35.859(java.sql.Timestamp)][stateProvinceGeoId,UP(java.lang.String)]

> (SQL Exception while executing the following:UPDATE POSTAL_ADDRESS SET
> STATE_PROVINCE_GEO_ID=?, LAST_UPDATED_TX_STAMP=?, LAST_UPDATED_STAMP=?
> WHERE CONTACT_MECH_ID=? (Cannot add or update a child row: a foreign key
> constraint fails (`ofbiz/postal_address`, CONSTRAINT `POST_ADDR_SPGEO`
> FOREIGN KEY (`STATE_PROVINCE_GEO_ID`) REFERENCES `geo` (`GEO_ID`)))))
>
>  
>
> The error definitely relates to "UP" since it works OK if I just change
> it to "CA". Is this an error in xml import or is this the way it is
> supposed to work?
>
>  
>
> Thanks in advance,
>
> Vinay Agarwal
>
>
> ------------------------------------------------------------------------
>
>  
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/users

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - PostalAddress with Foreign Country State

Jacopo Cappellato
In reply to this post by Vinay Agarwal
Well,

if you mean that it would be nice to have a user interface for geo data
I agree with you.
However, geo data are rather static information that can be imported
during the system setup via xml; the library of geo data currently in
OFBiz is slowly growing (as soon as users from different countries
contribute them to the project), you can see the ones available in:
framework/common/data/GeoData_*.xml

Jacopo

Vinay Agarwal wrote:

> Jacopo,
>
> I guessed that but isn't it too restrictive that anyone whose state isn't
> included in the database won't be able to enter his state id?
>
> Vinay
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> On Behalf Of Jacopo Cappellato
> Sent: Monday, March 20, 2006 8:45 AM
> To: OFBiz Users / Usage Discussion
> Subject: Re: [OFBiz] Users - PostalAddress with Foreign Country State
>
> Hi Viany,
>
> you probably just have to add a record in the Geo entity for the UP state.
>
> Jacopo
>
> Vinay Agarwal wrote:
>> Hello,
>>
>>  
>>
>> If I create a postal address, using XML import datasource, with
>> STATE_PROVINCE_GEO_ID set to a foreign country state ("UP"), I get the
>> following error
>>
>> ERROR: Error parsing entity xml file:
>> org.ofbiz.entity.GenericEntityException: Exception while updating the
>> following entity:
>>
> [GenericEntity:PostalAddress][contactMechId,CompAddrIndia(java.lang.String)]
> [lastUpdatedStamp,2006-03-20
>> 08:28:35.906(java.sql.Timestamp)][lastUpdatedTxStamp,2006-03-20
>> 08:28:35.859(java.sql.Timestamp)][stateProvinceGeoId,UP(java.lang.String)]
>
>> (while updating:
>>
> [GenericEntity:PostalAddress][contactMechId,CompAddrIndia(java.lang.String)]
> [lastUpdatedStamp,2006-03-20
>> 08:28:35.906(java.sql.Timestamp)][lastUpdatedTxStamp,2006-03-20
>> 08:28:35.859(java.sql.Timestamp)][stateProvinceGeoId,UP(java.lang.String)]
>
>> (SQL Exception while executing the following:UPDATE POSTAL_ADDRESS SET
>> STATE_PROVINCE_GEO_ID=?, LAST_UPDATED_TX_STAMP=?, LAST_UPDATED_STAMP=?
>> WHERE CONTACT_MECH_ID=? (Cannot add or update a child row: a foreign key
>> constraint fails (`ofbiz/postal_address`, CONSTRAINT `POST_ADDR_SPGEO`
>> FOREIGN KEY (`STATE_PROVINCE_GEO_ID`) REFERENCES `geo` (`GEO_ID`)))))
>>
>>  
>>
>> The error definitely relates to "UP" since it works OK if I just change
>> it to "CA". Is this an error in xml import or is this the way it is
>> supposed to work?
>>
>>  
>>
>> Thanks in advance,
>>
>> Vinay Agarwal
>>
>>
>> ------------------------------------------------------------------------
>>
>>  
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.ofbiz.org/mailman/listinfo/users
>
>  
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/users
>  
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/users
>

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users