Hibernate version:3.1.3
Mapping documents: <class table="TSRFILOT" name="Ilot" lazy="false"> <id column="idIlot" name="idIlot" type="string"> <generator class="fr.gouv.agriculture.telepac.fw.dao.hibernate.HibernateUuidGenerator"/> </id>
<property column="numeroIlot" name="numeroIlot" type="integer"/> <property column="codeInseeCommuneRattach" name="idCommuneRattachement" type="string" /> <property column="codeTypeIlot" name="idTypeIlot" type="string" /> <property column="surfaceReference" name="surfaceReference" type="integer"/> <property column="surfaceMesuree" name="surfaceMesuree" type="integer"/> <property column="surfaceAttribuee" name="surfaceAttribuee" type="integer"/> <property column="perimetre" name="perimetre" type="integer"/> <property column="presenceSna" name="presenceSna" type="boolean"/> <property column="presenceChevauchement" name="presenceChevauchement" type="boolean"/> <!--property column="geometrie" name="geometrie" type="string" /--> <property column="shape" name="shape" type="string"/> <property column="objectId" name="objectId" type="integer"/>
<set name="parcelles" inverse="true" cascade="all-delete-orphan"> <key column="idIlot"/> <one-to-many class="ParcelleCulturale"/> </set>
<many-to-one column="idDemande" name="demande" class="DemandeAide"/> <sql-insert> INSERT INTO TSRFILOT (IDDEMANDE,NUMEROILOT,CODEINSEECOMMUNERATTACH, CODETYPEILOT,SURFACEREFERENCE,SURFACEMESUREE, SURFACEATTRIBUEE,PERIMETRE,PRESENCESNA, PRESENCECHEVAUCHEMENT,SHAPE,OBJECTID, IDILOT) VALUES (?,?,?,?,?,?,?,?,?,?,ST_POLYFROMTEXT(?,1),?,?) </sql-insert> <sql-update> UPDATE TSRFILOT SET SHAPE=ST_POLYFROMTEXT(?,1),OBJECTID=?,PERIMETRE=?, SURFACEMESUREE=?,CODEINSEECOMMUNERATTACH=?, IDDEMANDE=?,CODETYPEILOT=?,SURFACEREFERENCE=?, PRESENCECHEVAUCHEMENT=?,SURFACEATTRIBUEE=?, NUMEROILOT=?,PRESENCESNA=?,IDILOT=? WHERE IDILOT=? </sql-update> <loader query-ref="loadIlot"/> </class>
<sql-query name="loadIlot"> <return alias="ilot" class="Ilot" lock-mode="none" /> SELECT IDDEMANDE AS {ilot.demande}, NUMEROILOT AS {ilot.numeroIlot}, CODEINSEECOMMUNERATTACH AS {ilot.idCommuneRattachement}, CODETYPEILOT AS {ilot.idTypeIlot}, SURFACEREFERENCE AS {ilot.surfaceReference}, SURFACEMESUREE AS {ilot.surfaceMesuree}, SURFACEATTRIBUEE AS {ilot.surfaceAttribuee}, PERIMETRE AS {ilot.perimetre}, PRESENCESNA AS {ilot.presenceSna}, PRESENCECHEVAUCHEMENT AS {ilot.presenceChevauchement}, ST_ASTEXT(SHAPE) AS {ilot.shape}, OBJECTID AS {ilot.objectId}, IDILOT AS {ilot.idIlot} FROM TSRFILOT WHERE IDILOT=? </sql-query>
Name and version of the database you are using:Oracle 10g
Bonjour,
Je travaille avec un outil SIG qui stocke un objet dans la colonne shape.
Je voudrais mapper mon attribut ilot.shape à ST_ASTEXT(shape) pour le select et à ST_POLYFROMTEXT(ilot.shape) pour un insert ou un update.
Mon loader fonctionne correctement mais seulement lorsque je fais un select par idIlot.
Lorsque je fais un SELECT par idDemande, la requete me retourne "shape as {ilot.shape}".
De plus, je n'arrive pas faire un update.
Merci d'avance pour votre aide
|