• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ORA-00928: missing SELECT keyword

 
jim li
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Entity
public class UserRating {

/**
* Unique ID for the table
*/
@Id
@GeneratedValue
private long id;

/**
* the Item being rated
*/
private long itemId;

/**
* A String representing the item Type
*/
private ItemType itemType;

/**
* The User doing the rating
*/
@ManyToOne(cascade=ALL)
private UserInfo user;

/**
* A Rating
*/
private int rating;

/**
* The date of the rating
*/
private Date date;



/**
* Get the id
* @return id
*/
public long getId() {
return id;
}

/**
* Set the id
* @param id id of the object
*/
public void setId(long id) {
this.id = id;
}

/**
* Get item type
* @return item type
*/
public ItemType getItemType() {
return itemType;
}

/**
* Set item type
* @param itemType item type
*/
public void setItemType(ItemType itemType) {
this.itemType = itemType;
this.setItemId(itemType.getItemId());
}

/**
* Get item ID
* @return item ID
*/
public long getItemId() {
return itemId;
}

/**
* Set item ID
* @param itemId item ID
*/
public void setItemId(long itemId) {
this.itemId = itemId;
}

/**
* Get userInfo
* @return userInfo
*/
public UserInfo getUser() {
return user;
}

/**
* Set UserInfo
* @param UserInfo UserInfo
*/
public void setUser(UserInfo user) {
this.user = user;
}

/**
* Get rating
* @return rating
*/
public int getRating() {
return rating;
}

/**
* Set rating
* @param rating rating
*/
public void setRating(int rating) {
this.rating = rating;
}

/**
* Get date
* @return date
*/
public Date getDate() {
return date;
}

/**
* Set date
* @param date date
*/
public void setDate(Date date) {
this.date = date;
}
}
hi guys

the above is my entity class, i could create the mapping object to the database, and i got a error when i excute the session create method:Caused by: java.sql.BatchUpdateException: ORA-00928: missing SELECT keyword


thank you
 
jim li
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have found the problem, it seems that it is the Data date object that cause my update to fail!
but i do not know why
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by jim li:
/**
* The date of the rating
*/
private Date date;

i have found the problem, it seems that it is the Data date object that cause my update to fail!
but i do not know why


Probably because "date" is a keyword in Oracle? You will have to probably rename the column of that table.
 
jim li
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you so much

it is fixed
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic