From: Amiel M. <bos...@gm...> - 2010-10-13 07:36:13
|
Now why do you always have the good stuff :) Luckily there is an er.extensions.ERXJDBCAdaptor.className property to override JDBCAdaptor class, but nonetheless, there are a number of classes needed to be subclassed as well to get to the JDBCColumn class. :( Amiel On Wed, Oct 13, 2010 at 9:09 AM, Mike Schrag <ms...@po...> wrote: > boo ... yeah, not in your version .... that sucks ... kind of hard for you > to do a custom one :\ some hackery with reflection in a JDBCChannel > subclass, probably, is the only way. or jad all of JDBCColumn and replace it > with an override. > > On Oct 12, 2010, at 5:55 PM, Amiel Montecillo wrote: > > Hey Mike, > > I'm not seeing a defaultColumnClass in EROraclePlugin or OraclePlugin. Its > only defaultExpressionClass that I can override. > > Thanks, > Amiel > > On Tue, Oct 12, 2010 at 10:17 PM, Mike Schrag <ms...@po...> wrote: > >> ah ok .. clears up that craziness. >> >> oracle made a mess of dates, but one thing you need to be careful of is >> that the value type you use matches the column type you declared in oracle, >> or it won't use an index ... basically it doesn't use an index on any data >> type conversion. >> >> if you're setting value type 'D', though, i would already expect that it's >> doing a setObject(..., Types.DATE) though. regardless, though, you can >> override defaultColumnClass on your PlugIn subclass and return a custom >> column subclass. >> >> as an aside, be careful about taking sql with merged bind variables as an >> accurate representation of your queries. oracle optimizes differently for >> the bind variable form of a sql statement compared to the non-bind variable >> version. so if you're testing those sql statements in sql developer, it's >> generally better to use bind variables there as well. >> >> ms >> >> On Oct 12, 2010, at 6:52 AM, Amiel Montecillo wrote: >> >> Hi Mike, >> >> Actually I saw the "to_timestamp" with the use of log4jdbc >> http://code.google.com/p/log4jdbc/. >> >> I felt the need to go beyond EOAdaptorDebugEnabled to print out the sql >> statement just before being pushed to the DB connection. >> >> With log4jdbc, you can see the evaluated sql statement instead of the >> "withBindings" logging from EOAdaptorDebugEnabled. >> >> Thanks, >> Amiel >> >> On Tue, Oct 12, 2010 at 9:45 PM, Mike Schrag <ms...@po...> wrote: >> >>> Soooo I don't even see any code that generates "to_timestamp". Any reason >>> you aren't using bind variables? The bind variables path through >>> OraclePlugIn already does a statement.setObject(x, timestamp, >>> date/timestamp) based on valueType. >>> >>> ms >>> >>> On Oct 12, 2010, at 1:20 AM, Amiel Montecillo wrote: >>> >>> >>> Tracked this down to >>> com.webobjects.jdbcadaptor.JDBCColumn.takeInputValue(). So it is always a >>> java.sql.Timestamp that goes to the preparedstatement. >>> >>> Is there a way to patch JDBCColumn with my own subclass? >>> >>> I'd like to change the Date is handled so that if the valueType is "D", >>> it will use java.sql.Date instead of Timestamp. >>> >>> Any idea is greatly appreciated. >>> >>> Thanks, >>> Amiel >>> >>> On Mon, Oct 11, 2010 at 10:54 AM, Amiel Montecillo <bos...@gm...>wrote: >>> >>>> Hi, >>>> >>>> I am debugging some slowness on my queries with oracle 11g. >>>> >>>> I have an "endDate" DATE column in one of my tables. >>>> >>>> In my model.plist: >>>> >>>> { >>>> allowsNull = Y; >>>> columnName = endDate; >>>> name = endDate; >>>> prototypeName = date; >>>> userInfo = {"_EntityModeler" = {generateSource = NO; }; }; >>>> valueType = D; >>>> }, >>>> >>>> EOF generates: >>>> >>>> SELECT t0.id FROM Bid t0 WHERE t0.endDate < *to_timestamp*('10/11/2010 >>>> 00:00:00.000', 'mm/dd/yyyy hh24:mi:ss.ff3') >>>> >>>> I was expected EOF to generate a "to_date" sql statement but instead I >>>> get the statement above thus performing a full table scan instead of making >>>> use of the endDate index. >>>> >>>> Am I missing something? >>>> >>>> Thanks, >>>> Amiel >>>> -- >>>> socket error: unable to connect to 127.0.0.1 >>>> >>> >>> >>> >>> -- >>> socket error: unable to connect to 127.0.0.1 >>> >>> ------------------------------------------------------------------------------ >>> Beautiful is writing same markup. Internet Explorer 9 supports >>> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. >>> Spend less time writing and rewriting code and more time creating great >>> experiences on the web. Be a part of the beta today. >>> >>> http://p.sf.net/sfu/beautyoftheweb_______________________________________________ >>> Wonder-disc mailing list >>> Won...@li... >>> https://lists.sourceforge.net/lists/listinfo/wonder-disc >>> >>> >>> >> >> >> -- >> socket error: unable to connect to 127.0.0.1 >> >> >> > > > -- > socket error: unable to connect to 127.0.0.1 > > > -- socket error: unable to connect to 127.0.0.1 |