Comments (1)
I've managed to create an implementation of the PersistenceManager that uses JOOQ instead of QueryDSL. It passes all our tests. Currently only long ids.
There are some interesting design differences between JOOQ and QueryDSL. The biggest difference is between the QueryDSL Expression
and the JOOQ Field
that both represent Columns, constants and other "expressions" in queries.
- JOOQ's
Field<DataType>
is not sub classed and the default implementation isfinal
. - QueryDSL's
Expression
is heavily sub classed: NumberExpression, ComparableExpression, etc.
As a result, in QueryDSL, the operations you can do on an Expression are determined by the specific interface that Expression implements. In JOOQ, all operations are defined in Field, so there is nothing stopping you from multiplying a Field<String>
with a Field<Number>
, and JOOQ will claim the result is a Field<String>
.
The advantage of the JOOQ way is that if you have a Field type that JOOQ doesn't know, it is easy to make it work. For our use this type safety is not an issue, since our ExpressionHandler already makes sure things are correct.
Since Field
can not really be sub classed, and our ExpressionHandler needs some way to pass our special Field types, I had to create a FieldWrapper interface with several implementations. In the end I think this is even cleaner than what I did in the QueryDSL back ends.
Another difference is that QueryDSL is very flexible in the order in which you add the different parts (join, where, from, etc) to the SQL query. JOOQ enforces a strict order, and you can't really have if
statements in between, since every step returns a different interface. As a result I had to change the piecemeal way of building the query we used so far to a "first gather all data, then build the query in one go" approach. In itself also not a bad change.
I'll implement the other two ID types, and add the JOOQ back-end as a separate option to the master branch at first. After testing more thoroughly I may at some point replace the QueryDSL back-ends with the JOOQ versions.
from frost-server.
Related Issues (20)
- Database auto-update for Basic Authentication does not work under some conditions HOT 3
- Helm chart bug: Mqtt not using external db connection string when frost.db.enableIntegratedDb is set to false HOT 4
- Server Error 500 when trying to patch a thing HOT 2
- Redirect URI not using `serviceRootUrl` HOT 3
- persistence_idGenerationMode_<ENTITY> is not applied HOT 5
- The phenomenonTime field on a MultiDatastream is updated based on the resultTimes, not the expected phenomenonTimes. HOT 1
- [Issue]SensorThings API with Tomcat 10 HOT 3
- GEOM column in Locations is sometimes created as NULL causing issues on the REST-API
- InternalMessageBus errors on fraunhoferiosb/frost-server-http HOT 5
- [Docker Image] Failed to initialize PostgreSQL DB HOT 10
- [Question]Can STA check duplicate data? HOT 1
- Disapperaing properties with empty string as value HOT 2
- Change Datastream/observationType to enum and check its values
- FROST Server very slow on large requests HOT 5
- Database is not using PhenomenonTime-Index HOT 5
- Issue With Authentication with FROST Server HOT 1
- Inconsistency in current Location of a Thing when Historical Locations are deleted or updated HOT 1
- Issue querying FROST-Server with umlauts in name HOT 4
- Query performance issues on Observations with plugins_coreModel_idType LONG HOT 3
- Using batch createObservations failed HOT 9
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 frost-server.