Comments (3)
Converting a String to a Long is frankly a strange thing to do, @Convert
is for allowing otherwise non-persistable things to be persisted by converting to an acceptable type. Clearly it could be possible to support such a thing with effort but I personally won't be doing so. You could contribute this if it is important to you
FYI, to persist you would need to update https://github.com/datanucleus/datanucleus-mongodb/blob/master/src/main/java/org/datanucleus/store/mongodb/fieldmanager/StoreFieldManager.java#L169 and to retrieve you would need to update https://github.com/datanucleus/datanucleus-mongodb/blob/master/src/main/java/org/datanucleus/store/mongodb/fieldmanager/FetchFieldManager.java#L246 but that would be just for String fields. Then you have Long, Short, Integer, Double, etc.
The fields that are supported for converters are "Object" field types (except the primitive wrappers).
from datanucleus-mongodb.
@andyjefferson okay I will check the code, so at the surface now the problem is not with the core or JDO module but rather the mongodb database module?
Yes, in fact it is strange, but there's a concrete use-case for this which is to query local time ranges (not date)
So one could query for a LocalTime
within a range of LocalTime
s (hence opens, and closes field)
And do, something like:
SELECT FROM mydomain.Hub WHERE this.schedules.contains(sch) && (sch.day == :schDay && sch.opens <= :startTime && sch.closes >= :endTime)
from datanucleus-mongodb.
See https://github.com/andyjefferson/mongodb-55 for updated testcase that strips out irrelevant code. Note that it could be simplified further and just have a class with a String field, rather than embedding a collection of some subtype with a String field!
from datanucleus-mongodb.
Related Issues (20)
- Load of query doesnt ensure that all SCOs are wrapped
- Detect attempt to add index on "_id" field
- Upgrade to v4.x of the MongoDB sync driver, support "MongoDatabase" rather than "DB"
- Check for schema existence of a class is unoptimised and should check for StoreData
- Support core-233
- Add support for "authentication database" HOT 4
- Incongruent exception on primary expressions HOT 2
- Support for ordering using unknown/invalid fields
- Resolution of inherited attributes broken if class is marked as non-cacheable HOT 8
- SSL support for mongo? HOT 1
- Support various other MongoClient properties
- Build against Mongo Java Driver v3.8.0
- Support nested embedded collection
- Support for specifying the MongoDB replica set
- mongodb-driver-core incompatible version downloaded from maven with mongodb-driver in datanucleus-mongodb pom.xml HOT 2
- Mongodb Authentication Database HOT 4
- Load of object doesnt check for tenantId when running multitenancy
- Move to mongodb-driver-legacy v4.3.1 HOT 1
- Add support for SoftDelete so that a delete just sets the flag rather than deleting
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datanucleus-mongodb.