Tagged Questions
0
votes
0answers
3 views
getResultList() generate org.hibernate.TransientObjectException: object references an unsaved transient instance
I'm aware that this problem has been asked several times before. But I believe I have a very different case, I'm currently encountering this error when invoking the getResultList() method, not when ...
1
vote
0answers
18 views
Hibernate save updating same row
I am working on Jersey, Hibernate and PostgresSQL and i trying to add asset with following code
@Path ("/assets")
public class AssetsService {
@PUT
@Produces("text/plain")
...
0
votes
0answers
48 views
Java hibernate Exception: missing column
I have a PostgreSQL table and a data class representing the table. I am using annotations for mapping instead of mapping xml files. I deleted some columns as they are not required from both the db ...
0
votes
2answers
39 views
postgres + hibernate, sequence in database is negative, why?
we have a very strange behaviour on our productions system.
db: posgres 9.0.13
spring: 3.1.2.RELEASE
hibernate: 3.5.3-Final
clustered tomcat setup with 5 tomcats running the same web app and ...
0
votes
2answers
45 views
how to implement auto increment id field per table with Hibernate and postgresql for one to many relationships
I have 4 entities one-to-many Message entity:
@Entity
@Table(name = "Messages")
public class Message {
...
@ManyToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "messagesounds_id")
...
0
votes
1answer
48 views
Error! connect Hibernate and Postgresql on eclipse
When i run project on eclipse, errors appear:
Jun 08, 2013 6:11:46 AM org.hibernate.annotations.common.Version
INFO: HCANN000001: Hibernate Commons Annotations
{4.0.2.Final} Jun 08, ...
-1
votes
2answers
46 views
how the list elements will be stored in java
Below is my code (postgresql,java,hibernate)
String squery="select starttime,reachtime from train where loc='hyderabad' ";
list=session.createSQLQuery(squery).list();
for(int ...
0
votes
2answers
19 views
Unable to add SSL support for database
I am using Spring3, Hibernate4 and postgres9.2.
For enabling the SSL database connection, I followed following steps :
Creating self signed Certificate : refer : ...
-1
votes
3answers
63 views
How to get the serial id just after inserting a row? [duplicate]
I have a table with row 'id' (a primary key) default set to serial in PostgreSQL. I insert into this row by calling
session.getCurrentSession().createSQLQuery("some insert query")
without adding ...
0
votes
1answer
22 views
Hibernation simple direct mapping
I have 2 tables employees and orders: Console screens_before execusion
Now i'm trying to map list collection to get all orders of each employee. My mapping:
@Entity
@Table(name = "employees", schema ...
0
votes
1answer
37 views
call postgres function with hibernate
I wrote a PostgreSQL function with return value VOID:
CREATE OR REPLACE FUNCTION queryinteriorexteriorcount()
RETURNS void AS .....
The function works quite well if i call it in pgAdmin.
But if i ...
0
votes
0answers
39 views
Error while Connecting postgres using Hibernate. - NullPointerException
Am getting below exception while connecting to postgresql,
INFO: HHH000046: Connection properties: {user=postgres, password=****}
Exception in thread "main" java.lang.NullPointerException
at ...
0
votes
1answer
21 views
Hibernate xml column definition
so this seems to be a bit of a hack but I've been looking at this code too long. I have a table that's id is a bpchar in postgres. The pojo is looking for a string and I am getting an error when the ...
0
votes
0answers
21 views
hibernate ant task hbm2java - org.hibernate.MappingException
I'm using hbm2java task (ibernate-tools 4.0.0-CR1) to generate the java pojos from a postgres db.
CREATE TABLE CO_ASGMT_WRKR_EV
(
ID_STR_RTL CHAR(32) NOT NULL,
ID_EV ...
0
votes
1answer
38 views
The Right Way To Do Evolutions In Play
I am currently working on a play app to be the backend API for a mobile app I'm developing.
Until now, I had set jpa.ddl to update and everything has been working fine. When I added a new field to ...
0
votes
1answer
20 views
Specifying index method when using @Index annotation
I'm using (spatial) hibernate annotations to create a schema for a spatial application that is implemented on top of PostGIS. When creating the database schema from my annotated classes, I'm in need ...
0
votes
1answer
39 views
How can I get a String from this Geometry Object with hibernate and PostGIS
I would like to return the output (Output is "0101000020E610000000000000000024400000000000002440" in geometry type) of this SQL Postgis query
select ST_GeometryFromText('POINT(10 10)',4326)
in Java ...
-2
votes
1answer
94 views
org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host
I am writing a web application that uses Hibernate to connect to Heroku Postresql. Everything works fine when the application is deployed to Heroku but I get the following exception when I run the ...
0
votes
1answer
40 views
Getting exception while accessing values from data base using hibernate
I have two tables website_availability and status_codes.And these have foriegn key relation between them.status_codes is parent table.I am using hibernate.I need "list" of values from these tables ...
-2
votes
0answers
23 views
CMS Open source API required [closed]
I need to create a CMS based Web Site in JAVA with some of the following proposed technologies: JAVA 7, Hibernate 3.x, Postgresql Database and Apache Tomcat. Could you please specify … what open ...
0
votes
1answer
54 views
Hibernate does not create Table in the database
I am using PostgreSQL and I am trying to run a simple Hibernate application, in particular the application decribed in the page. My hibernate.cfg.xml file is:
<?xml version="1.0" ...
0
votes
1answer
66 views
Creating multiple transactions in a single hibernate session
I have created a Quartz Job which runs in background in my JBoss server and is responsible for updating some statistical data at regular interval (coupled with some database flags)
To load and ...
0
votes
1answer
27 views
postgres sql logs for application users via hibernate
I've got web application using Spring. To connect with my database I'm using Hibernate. I've got requirement to log all SQL queries executed by application users (something like database logs per ...
0
votes
2answers
45 views
Issues with my criteria query when calling SQL created function
In my Postgres 9.1 database I have a li table that is mapped by ORM (Hibernate) in the following Li class:
package a.b;
@Entity
@Table(name = "li", schema = "public")
...
1
vote
2answers
58 views
Connecting PostgreSQL 9.2.1 with HIbernate
I have a blank Spring MVC project, and I've installed Hibernate and the PostgreSQL drivers using Maven.
I'm running short on complete tutorials that show how to connect PostgreSQL with Hibernate.
...
4
votes
2answers
91 views
Mapping Files and POJOS from Database for postgres not working
Im using Netbeans 7.3, Windows 7, Postgres 9.2,
I created a Java Web project with Hibernate 3.2.5 (driver = postgresql-9.2-1002.jdbc4)
I added the new project with the postgres database info,
...
0
votes
1answer
50 views
Dynamic hibernate connection
We developing a JSF app connecting to existing PostgreSQL DB using Hibernate. Each of our clients have their own PostgreSQL data base. Is it possible to host only one app dynamically
connecting to ...
0
votes
1answer
102 views
how to call postgres function with hibernate criteria
I am getting sorted results using hibernate criteria which generates the below sql:
select * from mytable order by name asc;
This is how i do it with hiberante criteria:
...
0
votes
1answer
67 views
How to normalize your database in hibernate? (Repeating values don't get saved again and again)
imagine I have a table called Photo and a table called Tag.
A Photo can have any amount of tags. Like a picture of the Brandenburg Gate in Berlin has as tags "Berlin", "Gate", ...
Now there is a ...
0
votes
1answer
56 views
Grails generating
I'm busy doing a fairly complex data migration from MySQL to Postgres on a Grails project.
I'm using GORM to generate the schema in PostGres and then doing MySQL -> mysqldump, some data manipulation ...
1
vote
2answers
131 views
Null pointer exception while using hibernate
I am using Hibernate and spring. this is my model class
@Entity
@NamedNativeQueries({@NamedNativeQuery(
name = "CSI_TARGET",
query = "select * from CSITARGET('CSIINDEX',2)",
...
1
vote
1answer
55 views
Missing table error while accessing a legacy PostgreSQL table with Grails
I have been trying to connect to a legacy table of a PostgreSQL database from my Grails App for a few days now without success.
What I want
All I want is to query this table (which has the users ...
0
votes
1answer
34 views
My sequence not works all the time postgreSQL
I encountered problems when using postgres sql
I have a inteface to add a folder (web application)
I have a table "file" with a column "ref_composant" I automatically generates the following manner.:
...
0
votes
1answer
83 views
Spring, Hibernate database query
I am trying to build simple spring security hibernate login app. But I have a problem geting result from Database with hibernate.
Here's my Service class that will query.
UserAccountService:
...
0
votes
1answer
63 views
No value specified for parameter 1
I am using Hiberante to connect to postgres database. I am trying to insert a record into the database. I have the values for the record in a string array which I got from a csv file. This is my dao ...
0
votes
1answer
29 views
Hibernate - my table is not mapped
I want to make a simple query with a getValueByLabel Method:
Here is my code:
public Config getValueByLabel(String label) throws EntityPersistException{
try {
Query query = ...
0
votes
1answer
81 views
Hibernate Postgresql Schema
I am accessing Postgresql db using hibernate POJO classes and mapping . Now I added a new schema called 'OCS' and not able to generate classes and mapping.Here is my hibernate.cfg.xml
...
1
vote
1answer
138 views
Hibernate-Spatial Query for Points within an area
Dear stackoverflow readers,
I'm currently working on an application that has the requirement to load specific items based on its coordinates. Example: I want all shops from coordinates x or within 15 ...
0
votes
1answer
241 views
Escaping special character in Hibernate select query with fts
I am having the query like these
Query query = session.createQuery("select object from EntityObject object where lower(object.columnName) like lower (E'%\\(test\\)%')");
and
Query query = ...
0
votes
1answer
106 views
spring, hibernate, postgres database query
I have a problem with my spring, hibernate app. I'm trying to make a login with spring security and im having little trouble geting my user account query to DB to work.
Problem is that my code will ...
0
votes
1answer
103 views
“relation not found” using Postgres within an Eclipse Hibernate application
Based on my previous unsolved question PostgreSql does not "recognize" table created by Hibernate I would like to ask if I do not do something right regarding the connection to PostgreSql ...
-1
votes
2answers
109 views
PostgreSql does not “recognize” table created by Hibernate
I have problem to create two associated tables with hibernate in a PostgreSQL database. I am inclined to believe that the problem lies in the Database (configuration?) since I have tried nearly all ...
1
vote
1answer
80 views
hibernate - error during frequent queries
I use server Tomcat + HttpServlet + hibernate. I test the server performance, for this, I created an application that simulates the operation 500 clients, each client with a periodicity repeats HTTP ...
1
vote
1answer
27 views
Insert into DB via hibernate
I have created this class which is created in my postgresql db:
@Entity
public class Test implements Serializable {
@Id
@GeneratedValue
private Long id;
@NotNull
...
0
votes
2answers
25 views
Error connection to herokupostgresql locally
I am writing a struts2 app and using hibernate for persistence. I deploy may app on heroku and everything works ok, but when ever I run it locally I get:
org.postgresql.util.PSQLException: FATAL:no ...
2
votes
2answers
308 views
Mapping postgreSQL JSON column to Hibernate value type
I have a table with a column of type json in my postgreSQL DB (9.2). I have a hard time to map this column to a JPA2 Entity field type.
I tried to use String but when I save the entity I get an ...
2
votes
1answer
98 views
Postgres idle connections: CannotAcquireResourceException
I have a web application in Java/ Wicket using Hibernate 4.1.1 and Spring 3.1.1 and Postgres 9.2. I also use spring transaction api and c3p0 connection pool.
My Problem is that the available ...
1
vote
1answer
61 views
Spring hibernate insert race condition
I am currently having a race issue with Spring Hibernate (transaction by annotation on service and daoImpl classes). Here is what I have encountered:
Tables:
Device Type: id (serial), name
Device: ...
3
votes
1answer
192 views
Transition H2 data to PostgreSQL
I am doing a transition from H2 database to PostgreSQL. As I found out - the SQL dump which is created when doing SCRIPT TO command on H2 contains several inappropriate constructions:
Unicode data ...
4
votes
2answers
478 views
Call getNextException to see the cause : How to make Hibernate / JPA show the DB server message for an exception
I am using Postgresql, Hibernate and JPA. Whenever there is an exception in the database, I get something like this which is not very helpful as it does not show what really went wrong on the DB ...