Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

ORA-00928: missing SELECT keyword

 
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
 
Sheriff
Posts: 10445
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
 
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic