I work with a RESTful web-service in Java/Spring and while trying to delete an entity object with the Id, I get the InvalidDataAccessApiUsageException error. The full error-stack is provided below, org.springframework.dao.InvalidDataAccessApiUsageExc
I have a component class @Component public class Scheduler { @Scheduled(fixedRate = 5000 ) public void test() { System.out.println("Hi"); } } But "Hi" is not being printed every 5 seconds. Why? My Confuration class is @ComponentScan( e
Is it possible to do a cascade save in Section.class? I create Section object and add new questions without id. When I try save it I get error: org.postgresql.util.PSQLException: ERROR: insert or update on table "question_to_section" violates fo
I am trying to use onetomany mapping for product specifications where I copied similar working code from descriptions. I am providing all my code. Caused by: javax.persistence.PersistenceException: [PersistenceUnit: sm-unit] Unable to build EntityMan
Hi i'm using below code for find article using spring with plain hibernate. public List<Article> getArticles(int currPosition, int pageSize) { Criteria c = getSession().createCriteria(Article.class); c.addOrder(Order.desc("createdDate"));
I'm developing a Spring application where everything is configured with maven (in pom.xml). My application uses a PostgreSQL database, but unit tests use an in-memory HSQLDB database. I just run into an issue with TEXT columns because they are not su
Here I read that length in @column is only for generated DDL. Is this true for precision and scale? @Column(precision = 15, scale = 5) private Integer myField; If so: How to define precision and scale for JPA-validation?The JPA javadocs and spec (lin
I am using Spring REST with Hibernate and I have developed a program in which data is coming from database calculate and it is updated into another table in database. But I want to run this program once in a day at a given time because I want to calc
I am new at Spring and trying to learn with tutorial. And I have a problem. I converted to xml based config to annotation based config. this is tutorial. And I receive HTTP 500 error. This is full stacktrace. SEVERE: Servlet.service() for servlet [di
I am trying to get Multi-Threading working in my Java web application and it seems like no matter what I try I run into some sort of issues with connection pooling. My current process is that I have am looping through all my departments and processin
What is the difference between FROM and SELECT clause in HQL.Is there any semantic difference in terms of results? I googled, but could not find any justifying answerThe Marko's anwser is complete but you can read examples from the official Hibernate
I try to build this jpa project but running into the same error. I updated, changed everything still nothing. What am I missing? I only use EclipseLink (JPA 2.0) in the libaries. NetBeans IDE 7.2. An annotation processor threw an uncaught exception.
This is the SQL statement: SELECT opc.contenido, COUNT(r.idOpcPregunta) from Opcionesrespuestas as opc LEFT JOIN Respuestasimples as r ON r.idOpcPregunta = opc.idOpcPregunta where opc.idPregunta ='6' GROUP BY opc.idOpcPregunta; This is a HQL select o
I have a grails project that uses hibernate to talk to a postgres db. I'm using the joda time plugin. I've been using their DateTime format 2013-01-25 22:28:55 to store dates. I need to know when something happened two weeks ago hince the variable de
public static UserDetail UserDetail.findUserDetail(Long id) { if (id == null) return null; return entityManager().find(UserDetail.class, id); } We are using spring Roo. Above is Roo generated finder method. Partial stack trace is as follows: Caused b
I can't extract result in hibernate.. I want to check an account when they sign in but it throws an exception: could not extract result. My sample code: My Pojo: @Entity @Table(name = "account") public class TestAccount implements Serializable {
I am storing values like names,password,username,email in database and i want that an id a primary column automatically created and it's value start with 1 and automatically increment . I am creating one class user and it has data member like i write
Is it posible to create a criteria for generating below sql: select name from (select distinct name from person) as aliasname order by lower(name); here there are two sql - select distinct name from person select name from <output of 1> as aliasname
I'm trying to persist data with Play 2 using JPA, but i'm getting: Execution exception [IllegalArgumentException: Unknown entity: models.Stream]; Stream.java ` package models; import javax.persistence.Entity; import javax.persistence.EntityManager; i
I'm now using the JPA2 @Cacheable annotation on my Entities, and all is working well. I now need to cache a ManyToOne association. In classic Hibernate, it was necessary to annotate the association with @Cache. @org.hibernate.annotations.Cache(usage=
I'm executing my maven build and it throws this exception: Last cause: Wrong column type in x.clients for column type. Found: tinyint, expected: integer I'm mapping like this: @Id @GeneratedValue(strategy = GenerationType.AUTO) private Integer id; An
I have written this Hibernate object DAO, however with this approach, it is using session per update approach (which I don't think it's right). The reason why I don't think its right because I am running into problems with my User class, which contai
I would like to define an entity which contains a list of something (for example embeddable) and each of these embeddables have a property active. At once, only one element inside the list is allowed to be active. How does one implement this in Hiber
I met a configuration problem like below: when I am executing example by hibernate tool After I have write <session-factory> <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property> <property name=
Given a very simple object: class User { private Integer id; private String name; public User() {} public Integer getId() { return id; } public String getName() { return name; } public void setName(String name) { this.name = name; } } and a very simp
I'm trying to run a simple dataImport class which is using JPA and Hibernate. If I run my class, i always have the following error: Exception in thread "main" java.lang.IllegalArgumentException: Unknown entity: ch.itartis.relman.entities.code.Re
Say there is a User table with structure: User List item userId (PK) company (PK) userName address ...etc And I want to retrieve users only for the current company (company can be changed by the user through UI, so the company is a runtime parameter)
I need to use an Entity framework with my application, and I have used table - partitions in Oracle database. With simple JDBC, I am able to select data from a specific partition. But I don't know whether I can do the same with hibernate or Eclipse l
I need a tool for converting database tables to entity java files for hibernate. There are 20 tables (mysql) and I don't want to copy table's column name to my Java file and so on. Any suggestions ? Thanks.Hibernate Tools. Keep in mind that entity cl
What is the FieldBridge for timestamp in HIbernate Search? @Field public java.sql.Timestamp approvedDate;When looking at the BridgeFactory source code, it seems there is no default FieldBridge for timestamps. I think you should provide your own custo