Skip to content

The-Alchemist/hibernate-postgresql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hibernate-postgresql

Extra type mapping for PostgreSQL-specific types such as hstore and inet for Hibernate.

I haven't written most of the code: I've just scoured the web for code that's already been written and tried to put it in one place.

Sources include:

Deprecation Notice

This project has been superceded by other projects such as https://github.com/vladmihalcea/hypersistence-utils.

How To Use

Java Source

@TypeDefs(value={
    @TypeDef(name = "hstore", typeClass = com.github.thealchemist.pg_hibernate.HstoreType.class),
    @TypeDef(name = "inet", typeClass = com.github.thealchemist.pg_hibernate.InetAddressType.class)
})
public class LoggedAction implements Serializable {
  @Type(type = "hstore")
  @Column(name="row_data", columnDefinition="hstore")
  private Map<String, String> rowData;
	
  @Column(name="client_addr", columnDefinition="inet")
  @Type(type="inet")
  private InetAddress clientAddr;

Maven Configuration (pom.xml)

        <dependency>
            <groupId>com.github.the-alchemist</groupId>
            <artifactId>hibernate-postgresql</artifactId>
            <version>1.0.18</version>
        </dependency>

Hibernate 5 Support

Hibernate 5 is supported starting with version 1.0.16

Full List of Supported Types

  • box
  • circle
  • hstore
  • inet
  • point
  • lineseg
  • polygon
  • string[]
  • intarray
  • xml

Contributions Welcome!

About

extra type mapping for PostgreSQL-specific types such as hstore and inet

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages