How to force Hibernate to return dates as java.util.Date instead of Timestamp?

So, I spent some time with this issue and found a solution. It is not pretty one, but at least a start point – maybe someone will supplement this with some useful comments. Some info about mapping that I found in process: Class that contains basic mapping of Hibernate types to property types is org.hibernate.type.TypeFactory. … Read more

How to make elasticsearch add the timestamp field to every document in all indices?

Elasticsearch used to support automatically adding timestamps to documents being indexed, but deprecated this feature in 2.0.0 From the version 5.5 documentation: The _timestamp and _ttl fields were deprecated and are now removed. As a replacement for _timestamp, you should populate a regular date field with the current timestamp on application side.

Entity Framework error – Error 11009: Property ‘ ‘ is not mapped

I had this issue when I changed a column name from CampaignKey to CampaignCode. After making the DB change, I went to the .edmx designer, right clicked and chose Update Model from Database. Then when I compiled I got the error: Error 11009: Property CampaignKey is not mapped. Taking a closer look at my table … Read more

Java mapping: Selma vs MapStruct [closed]

(Original author of Selma so slight different point of view) Selma and MapStruct does the same job with some differences. First it appears that Selma generated code is just a bit faster than MapStruct (http://javaetmoi.com/wp-content/uploads/2015/09/2015-09-mapping-objet-objet2.png). The 0.13 release number does not really reflects the maturity of code Selma is stable and robust it is in … Read more

How can I quickly estimate the distance between two (latitude, longitude) points?

The answers to Haversine Formula in Python (Bearing and Distance between two GPS points) provide Python implementations that answer your question. Using the implementation below I performed 100,000 iterations in less than 1 second on an older laptop. I think for your purposes this should be sufficient. However, you should profile anything before you optimize … Read more

JPA Cannot resolve column/IntelliJ

You have to associate your data source (create a data source in database view first – aka your real JDBC database connection) with a persistence unit or session factory (hibernate.cfg.xml). Follow below steps and the warnings will disappear: Open the Persistence tool window (View | Tool Windows | Persistence). Right-click the necessary module, persistence unit … Read more