cheptsov / kotlin-nosql

NoSQL database query and access library for Kotlin
212 stars 32 forks source link

DateTimeHandling Incorrect in MongoDBSession::getObject(doc: DBObject, column: AbstractColumn<*, *, *>) #15

Open cojo opened 8 years ago

cojo commented 8 years ago

Hi,

While using this package we've run into an issue with the dateTime() / DATE_TIME column type in MongoDBSession - while getObject(doc, schema) on line 489 properly handles DATE_TIME column type instantiation from the string pulled from Mongo, getObject(doc: DBObject, column: AbstractColumn<*, *, *>) on line 532 does not, and instead just does a basic doc.get which will fail for the DATE_TIME columns with something like:

java.lang.IllegalArgumentException: Can not set final org.joda.time.DateTime field expirationDate to java.lang.String

Let me know if you need further details or if there's anything else I can do to help. Thanks!