Note that there are some explanatory texts on larger screens.

plurals
  1. POERROR: syntax error at or near "user"
    primarykey
    data
    text
    <p>I'm using Hibernate and have a persistent class called "User". Since this is a keyword, I marked the @Entity attribute with a different name (I have seen, for example, this question: <a href="https://stackoverflow.com/questions/4350874/unable-to-use-table-named-user-in-postgresql-hibernate">Unable to use table named &quot;user&quot; in postgresql hibernate</a>)</p> <p>However, I still run into trouble because this class extends another, and it looks like hibernate is still trying to use "user" as a column name and getting messed up:</p> <pre><code>@Entity( name = "XonamiUser" ) public class User extends PropertyContainer { ... </code></pre> <p>and</p> <pre><code>@MappedSuperclass public abstract class PropertyContainer implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) protected long key; /** tags */ @ElementCollection protected Set&lt;String&gt; tags; @ElementCollection protected Set&lt;String&gt; searchList; ... </code></pre> <p>My other classes that extend PropertyContainer seem to work fine.</p> <p>Is this a bug in hibernate? Is there some way around this short of refactoring? Thanks!</p> <p>Here are the errors I'm seeing (slightly cleaned up):</p> <pre><code>WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 42601 ERROR org.hibernate.util.JDBCExceptionReporter - Batch entry 0 insert into user_search_list (user, search_list) values ('1', 'bjorn') was aborted. Call getNextException to see the cause. WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 42601 ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: syntax error at or near "user" Position: 31 </code></pre>
    singulars
    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.
 

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