postgresql « Map « JPA Q&A

1. How to map the type Interval in Hibernate?

under PostGresql, Im using PersistentDuration for the mapping between the sql type interval & duration but it doesnt work. An other user found the same issue & come with his own class:

public ...

2. Postgresql UUID supported by Hibernate?

I'm desperate, can't get Hibernate working with UUID for PostgeSQL. Here is the mapping using javax.persistence.* annotations:

private UUID itemUuid;

@Column(name="item_uuid",columnDefinition="uuid NOT NULL")
public UUID getItemUuid() {
    return itemUuid;

public void setItemUuid(UUID itemUuid) {

3. EclipseLink refuses to map native query on PostgreSQL to entity

I have a JPA entity class (one of many) and I can run JPQL queries on it, returning that entity without any problem. However, when I attempt to run any named ...

4. BIT postgresql and JAVA Byte mapping issue

ERROR [main] ( - ERROR: column "is_rectification_required" is of type bit but expression is of type smallint ERROR [main] ( - Could not synchronize database state with session org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert( at org.hibernate.exception.JDBCExceptionHelper.convert( at org.hibernate.jdbc.AbstractBatcher.executeBatch( at org.hibernate.engine.ActionQueue.executeActions( at org.hibernate.engine.ActionQueue.executeActions( ...

5. How to map postgresql domain type datatype?

create table Address ( id serial primary key, ... addressType AddressType not null, addressDescription text, isActive boolean not null );

6. Hibernate and PostgreSQL table inheritance

Greetings. PostgreSQL allows tables to inherit columns from other tables in a similar way it is in OO languages. See my question below. I have the following database schema. There is a table Resources, which has integer ID and varchar TYPE column. I also have a table Cars, which INHERITs from table Resources. Naturally, the Cars table will have "Cars" string ...

7. postgresql inheritance mapping

8. Hibernate use PostgreSQL table inheritance?

10. How to map Postgresql Interval type?

Is it possible to map a column (TIMETAKEN) in a Postgresql 7.3 database that has type interval? If so what hibernate mapping type should I use? I have attached the mapping file and the error that I get when I attempt to verify the schema. The below mapping type uses big_decimal, but i also tried timestamp, long, integer and short, all ...

11. mapping postgresql "create type"

Gosh that was sooo easy. For anybody else, here's the scoop. I want to create a Custom Data Type in PostgreSQL capable of storing a combination of local currency amount, currency code, exchange rate and base currency amount. So in psql ... Code: CREATE TYPE mymoney AS ( local_value numeric(11,2), ...

12. Map java.awt.point to Postgresql Point

13. PostgreSQL XML Type mapping (saving XML)

Versions: --Hibernate 3.2.5 --PostgreSQL 8.3 I've created a UserType to map the XML data (saved as Type XML) into beans using XMLBeans. This works perfectly fine. When it comes time to save the data I'm getting conversion errors (char to xml) thrown by PostgreSQL. I've overridden the nullSafeSet function and have tried multiple things: 1) Using PostgreSQL's functions to convert strings ...

14. Hibernate Annotation mapping to Postgresql Ltree sql type?

I would like to ask if there is a Hibernate supported type that maps to a Postgresql Ltree sql type? I am using Hibernate annotations and I have a table in my database that contains an Ltree field. I have tried doing a mapping with java Strings and byte arrays without any success. Is there a custom data type that has ...