Tagged Questions
0
votes
1answer
12 views
Generate values from db enum for jpa enum at runtime
I have seen on the internet ways to map a postgresql enum to a java enum. But all the methods i have seen do not fare well when i modify the enum in the DB. What i would want to do is create the java ...
2
votes
2answers
35 views
Batch update in Postgresql
I needed UPSERT functionality in Postgres. Since Postgres does not support this natively, I wrote a function which does that (tries to update, if no row was updated then inserts)
This is the template ...
0
votes
1answer
45 views
JPA Mapping Multi-Rows with ElementCollection
I'm trying to follow the JPA tutorial and using ElementCollection to record employee phone numbers:
PHONE (table)
OWNER_ID TYPE NUMBER
1 home 792-0001
1 work ...
0
votes
1answer
51 views
If exist return id else insert in postgres [duplicate]
I am new to postgres and i'm am having to populate a database using it. I cant submit my actual code for reference but my program is in java and i'm trying to do something along these lines.
IF ...
1
vote
1answer
21 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
35 views
JPA Integer Discriminator Values
I'm trying to follow the JPA tutorial and design a class hierarchy to represent the following table:
CREATE TABLE Entities (
entity_id INT PRIMARY KEY,
entity_type INT CHECK (0 <= entity_type ...
0
votes
2answers
59 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
0answers
15 views
Create installation bundle of apache + postgresql
I have developed a web application, that run on container Apache. It's actually a jar. It also uses a database structure, actually developed with hibernate and PostgreSql.
Anyone knows a good way to ...
0
votes
0answers
53 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
78 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
0answers
38 views
“FATAL: database does not exist” on postres, login is not working through app
I have these three steps bellow which I am executing every moment that I need to create a new environment for my app, the step 3 is just part of code...
On the first step I create the database, ...
0
votes
1answer
86 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, ...
0
votes
1answer
26 views
Postgres aborts transactions and ignores queries until the transaction is ended, is it possible to process the transaction before its rolled back?
I'm trying to improve upon error handling in a Java/Postgres application and an error that occurs frequently is input being too long for a column with a fixed length. I roll the transaction back when ...
-2
votes
2answers
44 views
How configure Tomcat postgresql jdbc and spring? [closed]
I've a problem...I have a Spring project that it works with Tomcat 7. Now I want to add a database to the project, in particular with Postresql and JDBC. Is there anyone who could help me?
(I'm sorry ...
-1
votes
2answers
47 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 ...