Tagged Questions
0
votes
0answers
6 views
Hibernate postgres bytea retrieval issue
I am using Hibernate 4.0 to store jpegs into postgres 9.1.4 (jdbc is postgresql-9.1-901.jdbc4.jar) bytea column(byte[] is the hibernate entity, without extra type def).
The hibernate storing process ...
0
votes
0answers
32 views
Save changes to database vaadin
I have an application which has a table and when you click on an item in the table it fills in a group of textfields with its data (FieldGroup), and then you have the option of saving the changes I ...
0
votes
0answers
29 views
Error connecting to postgres using sessionFactory
Im using spring 3.1.2, postgres 8.4, jdbc driver 9.0-801.jdbc4, OS redhat 6
Im doing a connection with hibernate 4.1.4.Final
I have this in my dataSource
<bean id="dataSource" ...
0
votes
1answer
33 views
Can't insert a Date object into a PostgreSQL Timestamp column using Hibernate
I am trying to use the primefaces schedule component, I found problem in inserting the date () in the database (postgresql), there is a problem of incompatibility between the date type of java and ...
0
votes
1answer
19 views
Hibernate @ManyToOne annotation creating only the child referencing existing parent table
I am currently working on a project in which i have to use manytoone relationship. I want to retrieve the parent from an existing table in the DB and map to a new child object. But each time i do this ...
0
votes
1answer
27 views
Can I continue to use Hibernate 3.0 when migrating PostgreSQL 8.2 to 9.2?
I'm working on a project that uses Hibernate 3.0. The program was released around 2007 and is connected to a PosgreSQL 8.2 Database.
As we want to relaunch the project (thousands and thousands lines ...
0
votes
1answer
34 views
Hibernate / postgreSQL
I am using Hibernate 3.6.4 on eclipse-Juno/EE with postgreSQL9.2.
I am not being able to run-- keep getting the following error log:
16:07:18,605 INFO [main] Main - ...
0
votes
0answers
30 views
Data Insertion error while using Spring Roo with Postgres
I'm very new to using Roo, Hibernate, and Postgres. I've been working on Java, JDBC and MySQL so far but I've had to change to the former platform recently.
I tried to create a basic CRUD web app ...
0
votes
1answer
26 views
Upgrade to Postgres 9.2 (incl. Hibernate) & Tomcat 7
We are planning an upgrade from PostgreSQL 8.2 to 9.2.4, and Tomcat from 6 to 7.
I have worked through various migration guide and want to ask you if you have any experience and whether there are any ...
0
votes
1answer
42 views
Hibernate @SqlInsert w/ PostgreSQL function — What does my function need to return?
I have a JPA app that is receiving GBs of string data each day. The biggest storage sink is a set of strings that can be pretty long and are repeated very often (maybe 1000 unique strings and I might ...
0
votes
0answers
34 views
Multiple schema postgres on hibernate
I'm new to hibernate.
In my web application, users after login have to point to different schema (with same tables) on the same postgres database to make queries.
Is there a method to specify at ...
0
votes
0answers
27 views
Unable to update a timestamp field of a table in PostgreSQL from hibernate
I have a table 'task' with a field 'updated_ts' of type Timestamp in PostgreSQL. I am trying to update this field using hibernate as follows:
Timestamp currentTimestamp= new Timestamp((new ...
0
votes
2answers
50 views
Hibernate nested query using criteria
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 ...
0
votes
0answers
54 views
How to create hibernate criteria with DISTINCT in this case
I am using hibernate criteria to create postgres query:
criteria.addOrder(Order.asc(property).ignoreCase()).setProjection(
...
1
vote
1answer
47 views
JPA/Hibernate + Postgres SequenceGenerator
I'm trying for the all day long get the Sequence from a Postgres with JPA/Hibernate, but it gives me all the time:
INFO: Hibernate:
call next value for tb_cdr_id_seq
WARN: SQL Error: 0, ...
0
votes
1answer
41 views
Hibernate autocommit true for a single command
Hibernate automatically sets autocommit to false, and indeed even recommends against setting it to true.
I find myself in the need of having autocommit set to true for a single database command (I ...
0
votes
2answers
114 views
Java, PostgreSQL, and Hibernate: Select statement with nested strings
I'm trying to unload data from RedShift to S3 using Java + Hibernate, but cannot figure out how to get it to accept the string-within-a-string in the SQL.
No matter the escape sequences I try to use ...
0
votes
1answer
41 views
Several Read-Only DB Connections in Spring and Hibernate
We have a Spring+Hibernate application (using Spring 2, from AppFuse 1.9) which is in a desperate need to be updated to Spring 3. We're slowly working on that.
In the meantime, I'd like to take some ...
0
votes
1answer
25 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
33 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
70 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
55 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
110 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
122 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
52 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
43 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
91 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
24 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
83 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
71 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 ...
1
vote
1answer
48 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
1answer
46 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
36 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
66 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
422 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
49 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 ...
0
votes
1answer
86 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
94 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
35 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
55 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
98 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
137 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
63 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
2answers
227 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
84 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
70 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
208 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
75 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
35 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
91 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:
...