Column lookup in ResultSet should be only "by label"

2013-05-10 Thread Christian Bauer
Version: 1.3.171 select ID as ITEM_ID from ITEM ResultSetMetaData#getColumnName(1) returns "ID" ResultSetMetaData#getColumnLabel(1) returns "ITEM_ID" This is correct. However, I should not be able to use the name for lookup on the ResultSet, only the label: ResultSet#findColumn("ID") returns 1

Regex match function?

2011-12-02 Thread Christian Bauer
Looking for a simple regexp() function, it was mentioned as "will implement" here but I can't find it: http://groups.google.com/group/h2-database/browse_thread/thread/5c651a6315f00ffb -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to th

Re: Infinite loop in trigger

2011-11-30 Thread Christian Bauer
On Nov 30, 2011, at 16:25 , Rami Ojares wrote: > I agree with you completely. And that is why I implemented my own > TriggerAdapter. Looks good, these enhancements should be added to the existing TriggerAdapter in H2. -- You received this message because you are subscribed to the Google Grou

Re: Infinite loop in trigger

2011-11-30 Thread Christian Bauer
On Nov 30, 2011, at 15:17 , Rami Ojares wrote: > Christian, you could implement your use case also as a before trigger. > There you could simply put your modified timestamp into the newRow array and > H2 will consider that as part of the update. I didn't know modifying the given arrays was supp

Re: Infinite loop in trigger

2011-11-30 Thread Christian Bauer
On Nov 30, 2011, at 14:39 , Noel Grandin wrote: > So, yes, your use-case is tricky to implement, but it's sufficiently rare > that it's not worth complicating the Trigger > API for it. Seriously? This is the ONLY trigger example in a whole 800 page book I'm writing about persistence and you t

Re: Infinite loop in trigger

2011-11-30 Thread Christian Bauer
On Nov 29, 2011, at 18:28 , Noel Grandin wrote: > Implement the Trigger interface and check the oldRow vs newRow > parameters to see which fields have changed. This is the workaround: public class UpdateLastModifiedTrigger extends TriggerAdapter { public static final String COLUMN_ID = "ID

Infinite loop in trigger

2011-11-29 Thread Christian Bauer
This TriggerAdapter updates the LASTMODIFIED column of the inserted or updated row: @Override public void fire(Connection conn, ResultSet oldRow, ResultSet newRow) throws SQLException { if (newRow == null ) return; // This is a DELETE PreparedStatement statement = conn.pr

Re: LOBs should be valid until end of transaction?

2011-11-28 Thread Christian Bauer
The following test fails on H2 but works on Derby: public static void main(String args[]) throws Exception { Connection conn = DriverManager.getConnection("jdbc:derby:test;create=true"); //Connection conn = DriverManager.getConnection("jdbc:h2:tcp://localhost/mem:test", "sa", ""); c