Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I eventually made this "work" - in a hackish sort of way - by turning off schema validation.</p> <p>Previously, I had <code>&lt;property name="hibernate.hbm2ddl.auto" value="validate"/&gt;"hibernate.hbm2ddl.auto"</code> in my persistence.xml. When I commented out this property, my app server started and the model "worked".</p> <p>The final form of my entity was:</p> <pre><code>@Entity @Table(schema = "content", name = "theme") public class Theme extends AbstractBaseEntity { private static final long serialVersionUID = 1L; @Column(name = "run_from", columnDefinition = "timestamp with time zone not null") @NotNull @Temporal(TemporalType.TIMESTAMP) private Date runFrom; @Column(name = "run_to", columnDefinition = "timestampt with time zone not null") @NotNull @Temporal(TemporalType.TIMESTAMP) private Date runTo; /* Getters, setters, .hashCode(), .equals() etc omitted */ </code></pre> <p>After reading quite a bit on this, I got the impression is that there is no easy way to map Postgresql timestamp with time zone columns. </p> <p>Some JPA implementation + database combinations support this natively ( EclipseLink + Oracle is one example ). For hibernate, with jodatime extensions, it is possible to store timezone aware timestamps using a normal timestamp + a varchar field for the timezone( I could not do that since I was constrained from changing the database schema ). <a href="http://usertype.sourceforge.net/">Jadira user types</a> or completely custom user types can also be used to tackle this problem.</p> <p>I need to note that my use-case for this entity is "read only", so I could get away with a seemingly naive "solution". </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload