Win a copy of Mastering Non-Functional Requirements this week in the Design forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate adding .value,.count,.offset, and hash to query  RSS feed

Annie McCall
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate version: hibernate 3.2.0.cr2

Mapping documents:Annotations

Name and version of the database: Oracle 92


Before I show you my code....I explain my problem.
It seems like Hib is adding 4 columns to my query.
Below is the actual SQL that is being generated:
select feedlog0_.FEED_ID as col_0_0_,
feedtype1_.FEED_DESC as col_1_0_,
feedlog0_.FEED_ID as FEED1_3_,
feedlog0_.CRTD_DT as CRTD2_3_,
feedlog0_.FEED_TYPE as FEED3_3_,
feedlog0_.RESULT_STATUS as RESULT4_3_,
feedlog0_.value as value3_,
feedlog0_.offset as offset3_,
feedlog0_.count as count3_,
feedlog0_.hash as hash3_
from FEED_LOG_TB feedlog0_, FEED_TYPE_TB feedtype1_
where feedlog0_.FEED_TYPE=feedtype1_.FEED_CODE

(don't understand how hib is getting .value, .count, .hash, and .offset; I don't have those columns in my table or bean)

now my code:
my bean:
package com.annie.hcp.businessbeans;

import java.util.Date;
import java.text.NumberFormat;
import java.util.Locale;
import java.math.BigInteger;

import javax.persistence.*;
query="SELECT fl, ft.feedDesc " +
"FROM FeedLog fl, FeedType ft " +
"WHERE fl.feedTypeCode = ft.feedCode")

public class FeedLog implements Serializable {
private static final long serialVersionUID = 7526472295622776147L;

private BigInteger feedId;
private Date crtdDt;
private String feedTypeCode;
private BigInteger resultStatus;
private String feedName;
private double dblAmount;
private int statusName;
private int noOfRecs;

private String feedDesc;
public String getFeedDesc() {
return feedDesc;

public void setFeedDesc(String feedDesc) {
this.feedDesc = feedDesc;

public Date getCrtdDt(){

return this.crtdDt;

public void setCrtdDt(Date param){

this.crtdDt = param;

/* Feed Type */

public String getFeedTypeCode(){

return this.feedTypeCode;

public void setFeedTypeCode(String param){

this.feedTypeCode = param;

/* Double Amount */

public String getDblAmount(){

NumberFormat n = NumberFormat.getCurrencyInstance(Locale.US);

String s = n.format(dblAmount);
return s;


public void setDblAmount(double param){

this.dblAmount = param;

public String getFeedName() {
return feedName;

public void setFeedName(String feedName) {
this.feedName = feedName;

public int getStatusName() {
return statusName;

public void setStatusName(int statusName) {
this.statusName = statusName;

public int getNoOfRecs() {
return noOfRecs;

public void setNoOfRecs(int param){

this.noOfRecs = param;

public BigInteger getFeedId() {
return feedId;

public void setFeedId(BigInteger feedId) {
this.feedId = feedId;
public BigInteger getResultStatus() {
return resultStatus;

public void setResultStatus(BigInteger resultStatus) {
this.resultStatus = resultStatus;
public void setFeedType(FeedType feedType1) {
this.feedType1 = feedType1;

public FeedType getFeedType1() {
return feedType1;

public void setFeedType1(FeedType feedType1) {
this.feedType1 = feedType1;

public void setFeedType(FeedType feedType) {
this.feedType = feedType;

public String getFeedCode() {
return feedCode;

public void setFeedCode(String feedCode) {
this.feedCode = feedCode;

public FeedType getFeedtype() {
return feedtype;

public void setFeedtype(FeedType feedtype) {
this.feedtype = feedtype;

... Now the code from another class where I call the named query:

BaseHibernateDao dao = DaoFactory.getExpenseDao();
/* get days from web.config */
FacesContext facesContext =
ServletContext servletContext = (ServletContext)
Object[] params = new Object[1];
params[0] =(BigInteger) this.feedDays;
this.feedLogList = (ArrayList)dao.findByNamedQuery ("FeedLog.getFeedsSummary


and here is the error message I receive....
detailMessage= "ORA-00904: "FEEDLOG0_"."HASH": invalid identifier\n"

I have to admit I am new to hibernate and Spring.
Why is hibernate adding those additional 4 columns (.count, .offset, .hash, .value) ??? Query works fine without those columns.

Thanks in advance
nachospiu el pollo
Posts: 1
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!