On Tue, Oct 28, 2008 at 5:08 PM, Fabio D'Ovidio <[EMAIL PROTECTED]>wrote:
> Hello.
> I'm trying to map my new data in geoserver to DHIS in organisationunit
> table
> My mapping.xml is as following for new layers:
>
> <util:map id="locationToLayerMap">
>
> <entry key="[Location].[OrgUnit5]" value="who:regioni"/>
> <entry key="[Location].[OrgUnit6]" value="who:province"/>
> <entry key="[Location].[OrgUnit7]" value="who:comuni"/>
> </util:map>
>
> <util:map id="locationToGeocodedPropertyNameMap">
>
> <entry key="[Location].[OrgUnit5]" value="cod_reg"/>
> <entry key="[Location].[OrgUnit6]" value="cod_pro"/>
> <entry key="[Location].[OrgUnit7]" value="pro_com"/>
> </util:map>
>
> Now I want to put using kettle cod_reg and name values of my SHP file in
> oranisationunit table..something like:
>
> INSERT INTO organisationunit(organisationunitid, shortname, "name",
> geocode) VALUES ( 0, 'PIEMONTE', 'PIEMONTE', 1)
> etc...etc...
>
> the problem is: how can I set value in order to not violate constrains
> on foreign key? (in particular on parentid and organisationunitid field)?
>
> Thank u !
The organisationunit id auto-increment field depends on the database, for
postgres you can use nextval('hibernate_sequence') , for mysql you can
simply omit the field.
The parentid field can simply be omitted, or you can insert the parent first
and then use the generated identifier.
Lars
_______________________________________________
Dhis-users mailing list
[email protected]
http://www.hisp.info/mailman/listinfo/dhis-users