title: org.hibernate.exception.GenericJDBCException: ERROR: cross-database references are not implemented
body: <p>1) Dispatcher-Servlet</p>
  
  <pre><code>&lt;bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
      &lt;property name="driverClassName" value="${driverClassName}"/&gt;
      &lt;property name="url" value="${url}"/&gt;
      &lt;property name="username" value="${username}"/&gt;
      &lt;property name="password" value="${password}"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt;
      &lt;property name="dataSource" ref="dataSource"/&gt;
      &lt;property name="configLocation"&gt;
          &lt;value&gt;classpath:hibernate.cfg.xml&lt;/value&gt;
      &lt;/property&gt;
  
      &lt;property name="hibernateProperties"&gt;
          &lt;props&gt;
              &lt;prop key="hibernate.dialect"&gt;${dialect}&lt;/prop&gt;
              &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
              &lt;prop key="hibernate.default_catalog.null"&gt;&lt;/prop&gt;       
          &lt;/props&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>2) database.properties</p>
  
  <pre><code>driverClassName=org.postgresql.Driver
  dialect=org.hibernate.dialect.PostgreSQLDialect
  url=jdbc:postgresql://192.168.1.20:5432/GSW
  username=postgres
  password=postgres
  </code></pre>
  
  <p>3) Java Class</p>
  
  <pre><code>@Entity
  @Table(name = "std_users_v", catalog = "GSW", schema = "public")
  @NamedQueries({
  @NamedQuery(name = "StdUsersV.findAll", query = "SELECT s FROM StdUsersV s")})
  public class StdUsersV implements Serializable {
  private static final long serialVersionUID = 1L;
  @Id
  @Column(name = "id")
  private Integer id;
  @Column(name = "user_group_id")
  private BigInteger userGroupId;
  @Size(max = 50)
  @Column(name = "user_name", length = 50)
  private String userName;
  @Size(max = 100)
  @Column(name = "password", length = 100)
  private String password;
  @Column(name = "org_unit_id")
  private BigInteger orgUnitId;
  @Column(name = "active_flag")
  private Boolean activeFlag;
  @Column(name = "start_date")
  @Temporal(TemporalType.TIMESTAMP)
  private Date startDate;
  @Column(name = "end_date")
  @Temporal(TemporalType.TIMESTAMP)
  private Date endDate;
  @Column(name = "created_by")
  private BigInteger createdBy;
  @Column(name = "creation_date")
  @Temporal(TemporalType.TIMESTAMP)
  private Date creationDate;
  @Column(name = "updated_by")
  private BigInteger updatedBy;
  @Column(name = "update_date")
  @Temporal(TemporalType.TIMESTAMP)
  private Date updateDate;
  @Size(max = 20)
  @Column(name = "user_group_name", length = 20)
  private String userGroupName;
  getters and setters...
  </code></pre>
  
  <p>I am using Postgresql. While i am trying to fetch data from Table StdUserV.java i am getting the following error-</p>
  
  <pre><code>org.hibernate.exception.GenericJDBCException: ERROR: cross-database references are not     implemented: "gsw.public.std_users_v"
  </code></pre>
  
  <p>I have googled around and found the solution that i need to remove bolded text from <strong>gsw.public</strong>.std_users_v (i.e. catalog) but i am not getting how can i do it. The property "hibernate.default_catalog.null" was one effort towards this issue. I welcome the other solutions too for this "cross-reference" problem.
  Please help.</p>