Spring Controller to handle all requests not matched by other Controllers

If your base url is like that= http://localhost/myapp/ where myapp is your context then myapp/a.html, myapp/b.html myapp/c.html will get mapped to the first 3 method in the following controller. But anything else will reach the last method which matches **. Please note that , if you put ** mapped method at the top of your … Read more

Incompatible Data Reader Exception From EF Mapped Objects

The message means that the results of the stored procedure do not contain a column named ValudationId. Double check your select statement and run it in SSMS to ensure that you’re bringing back that column. EDIT: Your procedure does not contain a select statement. You need to select the inserted identity value (using the scope_identity() … 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.

How do you map a “Map” in hibernate using annotations?

You could simply use the JPA annotation @MapKey (note that the JPA annotation is different from the Hibernate one, the Hibernate @MapKey maps a database column holding the map key, while the JPA’s annotation maps the property to be used as the map’s key). @javax.persistence.OneToMany(cascade = CascadeType.ALL) @javax.persistence.MapKey(name = “name”) private Map<String, Person> nameToPerson = … Read more

IndexOutOfRangeException Deep in the bowels of NHibernate

Yes its a common problem, you are using the Column “EndDate” twice in your mapping definition (for both Company and PrimaryListing) and that is not allowed. One of them has to go, or have an additional EndDate column (one for each association) check this too nHibernate 2.0 – mapping a composite-id *and* many-to-one relationship causes … Read more