Is something up with applying By to a MappedBoolean?

6 views
Skip to first unread message

E. Biggs

unread,
Jun 2, 2009, 10:24:46 PM6/2/09
to Lift
When I try to apply By to a MappedBoolean like so:

Table.findAll(By(Table.booleanField, false)); derby is unhappy and
bombs out on some sql with this kind of where clause:

WHERE Table.booleanfield = ?

Is this a bug or am I doing something wrong? I'm using 1.1-SNAPSHOT

Timothy Perrett

unread,
Jun 3, 2009, 3:46:53 AM6/3/09
to Lift
Is there an exception? If so could you post the entire trace?

Cheers, Tim

E. Biggs

unread,
Jun 4, 2009, 12:47:25 PM6/4/09
to Lift
here's my derby log:

Cannot find the network server class,
org.apache.derby.impl.drda.NetworkServerControlImpl. Your class path
should contain derbynet.jar.
----------------------------------------------------------------
2009-06-03 02:18:26.023 GMT:
Booting Derby version The Apache Software Foundation - Apache Derby -
10.4.2.0 - (689064): instance a816c00e-0121-a3e9-03ce-000000c22fe0
on database directory /Users/ebiggs/Documents/workspace/maps/
lift_example

Database Class Loader started - derby.database.classpath=''
2009-06-03 02:18:27.693 GMT Thread[Thread-14,5,main] (XID = 437),
(SESSIONID = 0), (DATABASE = lift_example), (DRDAID = null), Cleanup
action starting
2009-06-03 02:18:27.693 GMT Thread[Thread-14,5,main] (XID = 437),
(SESSIONID = 0), (DATABASE = lift_example), (DRDAID = null), Failed
Statement is: SELECT DISTINCT Property.id, Property.propertygroup,
Property.streetnumber, Property.street, Property.unit, Property.city,
Property.state, Property.zip, Property.price, Property.dom,
Property.beds, Property.baths, Property.lotsize, Property.sqft,
Property.status, Property.orgprice, Property.proptype,
Property.numpricechanges, Property.spop, Property.dollarstosqft,
Property.yearbuilt, Property.date_c, Property.geocodesuccess,
Property.lat, Property.long_c, Property.geocodeattempted FROM
Property WHERE geocodeattempted = ?
java.lang.NullPointerException
at java.io.StringReader.<init>(StringReader.java:33)
at org.apache.derby.impl.services.uuid.BasicUUID.<init>(Unknown
Source)
at org.apache.derby.impl.services.uuid.BasicUUIDFactory.recreateUUID
(Unknown Source)
at
org.apache.derby.impl.sql.catalog.SYSCONGLOMERATESRowFactory.buildDescriptor
(Unknown Source)
at
org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaIndexMinion
(Unknown Source)
at
org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaIndex
(Unknown Source)
at
org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getConglomerateDescriptorsScan
(Unknown Source)
at
org.apache.derby.impl.sql.catalog.DataDictionaryImpl.finishTableDescriptor
(Unknown Source)
at
org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getTableDescriptorIndex1Scan
(Unknown Source)
at
org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getUncachedTableDescriptor
(Unknown Source)
at org.apache.derby.impl.sql.catalog.NameTDCacheable.setIdentity
(Unknown Source)
at org.apache.derby.impl.services.cache.ConcurrentCache.find(Unknown
Source)
at
org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getTableDescriptor
(Unknown Source)
at org.apache.derby.impl.sql.compile.QueryTreeNode.getTableDescriptor
(Unknown Source)
at org.apache.derby.impl.sql.compile.FromBaseTable.bindTableDescriptor
(Unknown Source)
at org.apache.derby.impl.sql.compile.FromBaseTable.bindNonVTITables
(Unknown Source)
at org.apache.derby.impl.sql.compile.FromList.bindTables(Unknown
Source)
at org.apache.derby.impl.sql.compile.SelectNode.bindNonVTITables
(Unknown Source)
at org.apache.derby.impl.sql.compile.DMLStatementNode.bindTables
(Unknown Source)
at org.apache.derby.impl.sql.compile.DMLStatementNode.bind(Unknown
Source)
at org.apache.derby.impl.sql.compile.CursorNode.bindStatement(Unknown
Source)
at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown
Source)
at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
at
org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement
(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown
Source)
at org.apache.derby.jdbc.Driver30.newEmbedPreparedStatement(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement
(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement
(Unknown Source)
at net.liftweb.mapper.DB$$anonfun$prepareStatement$1.apply(DB.scala:
278)
at net.liftweb.mapper.DB$$anonfun$prepareStatement$1.apply(DB.scala:
277)
at net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:241)
at net.liftweb.util.Helpers$.calcTime(Helpers.scala:29)
at net.liftweb.mapper.DB$.prepareStatement(DB.scala:277)
at net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1.apply
(MetaMapper.scala:306)
at net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1.apply
(MetaMapper.scala:298)
at net.liftweb.mapper.DB$.use(DB.scala:305)
at net.liftweb.mapper.MetaMapper$class.findMapFieldDb
(MetaMapper.scala:297)
at com.yo.model.Property$.findMapFieldDb(Property.scala:5)
at net.liftweb.mapper.MetaMapper$class.findMapDb(MetaMapper.scala:
293)
at com.yo.model.Property$.findMapDb(Property.scala:5)
at net.liftweb.mapper.MetaMapper$class.findAll(MetaMapper.scala:259)
at com.yo.model.Property$.findAll(Property.scala:5)
at com.yo.controller.Geocoder$.beginGoogleGeocoding(Geocoder.scala:
33)
at com.yo.controller.Geocoder$.beginGeocoding(Geocoder.scala:29)
at com.yo.controller.Geocoder$$anonfun$act$1$$anonfun$apply$1.apply
(Geocoder.scala:23)
at com.yo.controller.Geocoder$$anonfun$act$1$$anonfun$apply$1.apply
(Geocoder.scala:21)
at scala.actors.Reaction.run(Reaction.scala:78)
at scala.actors.Scheduler$$anon$2.run(Scheduler.scala:77)
at scala.actors.FJTaskRunner.scanWhileIdling(Unknown Source)
at scala.actors.FJTaskRunner.run(Unknown Source)
Cleanup action completed

E. Biggs

unread,
Jun 15, 2009, 6:15:19 AM6/15/09
to Lift
Any Ideas? I've tried distilling this down to just a most basic
example:


object BoolTest extends BoolTest with KeyedMetaMapper[Long, BoolTest]
{
override def dbTableName = "BoolTest"
override def fieldOrder = id :: testField :: Nil
}

class BoolTest extends KeyedMapper[Long, BoolTest] {
def getSingleton = BoolTest
def primaryKeyField = id

object id extends MappedLongIndex(this)

object testField extends MappedBoolean(this)
}


And I still get:
2009-06-15 10:06:44.163 GMT Thread[Thread-14,5,main] (XID = 489),
(SESSIONID = 0), (DATABASE = lift_example), (DRDAID = null), Failed
Statement is: SELECT DISTINCT BoolTest.id, BoolTest.testfield FROM
BoolTest WHERE testfield = ?

When I do:

val abc = BoolTest.findAll(By(BoolTest.testField, true))

on start up.


Any ideas? Or should I report a bug or what?

E. Biggs

unread,
Jun 19, 2009, 3:56:19 PM6/19/09
to Lift
an indication at this point that somebody cares about this besides me
would be like gold....

At this point, I'm assuming it's a bug and am fumbling through the
mapping code which is taking me a bit of time to understand....

David Pollak

unread,
Jun 19, 2009, 4:02:27 PM6/19/09
to lif...@googlegroups.com
Please open a ticket at http://github.com/dpp/liftweb/issues

I know Derek has closed a fair number of related tickets.  Also, please make sure you're using 1.1-SNAPSHOT
--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

Derek Chen-Becker

unread,
Jun 22, 2009, 12:46:57 PM6/22/09
to lif...@googlegroups.com
I was starting to look at this (and the MappedStringIndex issue) but I'm swamped with my day job right now. Please open an issue and I'll look at it hopefully in the next week or two.

Derek
Reply all
Reply to author
Forward
0 new messages