You can now do something like:
<class name="Role">
<sql-insert>insert into Role (name, id) values (?, ?) /** i did this */</sql-insert> <sql-delete>delete from Role where id=?</sql-delete>
<id name="id" type="long">
<generator class="native"/>
</id> <property name="name" type="string"/>
</class> This is the basic first step for having support for user specified sql for CUD operations (Read is done by HQL, Criteria or createSQLQuery()).
I call it "crude" because you need to put the ?'s in the exact same sequence as hibernate expects them.
To help users (and me) to see what the heck hibernate expects you can activate logging of the basic sql.
### enable logging of CUD sql (et.al)### log4j.logger.net.sf.hibernate.persister.BasicEntityPersister=debug
this will print out the "default <sql-xxx> that hibernate generates.
The next step will be for me to add support for callable="true" which will enable us to seamingly have Stored Procedure/function support
(with some small restrictions).
And after that I/We should look into how we can support something like:
<sql-insert>insert into Role (id, name, street, city, value, unit) values (:id, ;name, :address.street,:address.city, :amount.1, :amount.2)</sql-insert>
so it get's alot easier to define this custom sql.
The amount.1 and amount.2 is for component support - where we don't know the name of the property, but just the ordinal position as defined by the UserType "contract".
Any feedback are welcome (i know we need to remove the CustomSQL dependency in the persisters but that's easy as soon as we find a better abstraction/normalization for it ;)
.....my notes are available at http://hibernate.org/187.html
Best regards, Max Rydahl Andersen
------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel