Skip to content
Advertisement

Tag: jpa

JPA distinct inner join with Condition on joined table

I have two tables below: I want to get the college object with list of students of a specific department. The SQL query is below: So far I have tried the below JPA query but it is returning multiple College objects. How to return a single college object with list of students with filtered department? NOTE: I can’t alter the

Hibernate not allowing to increment by 5 in sequence

I have following db sequence Java However with Hibernate I am getting following error which says hibernate is expecting increment by 50. Why is so? Edit1 Added java code. Answer The error message is quite clear. You have enabled (or not disabled) schema validation, so when the application starts Hibernate is comparing the database with what it expects from annotations

MSSql server jpa spatial exception

Is it possible to use sql spatial data in jpa? I ve MS SQL Server 2014 Express Edition. I m trying to use spatial data as follows; maven (pom.xml) dependencies; db dialect; spring.jpa.hibernate.dialect=org.hibernate.spatial.dialect.sqlserver.SqlServer2008SpatialDialect entity definition; @Column(columnDefinition = “Geometry”) private Point location; creation of data; SampleEntity se = new SampleEntity(); se.setName(“Sample1”); se.setAge(30); GeometryFactory gf = new GeometryFactory(new PrecisionModel(), 4326); Point location1

Advertisement