Hi All, Thanks for it , now my second question is if i have 2 classes and the relationship is indicated below:
ImageProcessingTemplate (1) -> (M) PageProcessing And for efficiency, I kept all in 1 table. Which means the design of the table is something like the below: ID | ImageProcessingTemplateID Therefore the ID is unique while image processing templateID may be duplicated therefore in my mapping how can i map a sub class ID as a paremeter in my parent custom sql insertion statement ? On Jun 12, 2:11 am, Fabio Maulo <[email protected]> wrote: > For each class/collection you have: loader, > sql-insert, sql-update, sql-delete > > <class name="Person" table="PERSON"> > <id name="Id" unsaved-value="0" column="PERID"> > <generator class="increment"/> > </id> > <property name="Name" not-null="true" column="NAME"/> > <loader query-ref="person"/> > <sql-insert>INSERT INTO PERSON (NAME, PERID) VALUES ( UPPER(?), ? > )</sql-insert> > <sql-update>UPDATE PERSON SET NAME=UPPER(?) WHERE PERID=?</sql-update> > <sql-delete>DELETE FROM PERSON WHERE PERID=?</sql-delete> > </class> > > <sql-query name="person"> > <return alias="p" class="Person" lock-mode="upgrade"/> > SELECT NAME AS {p.Name}, PERID AS {p.Id} FROM PERSON WHERE PERID=? FOR > UPDATE > </sql-query> -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
