Announcement Announcement Module
No announcement yet.
SQLGrammarException for Unmapped Properties Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQLGrammarException for Unmapped Properties

    i am facing SQLGrammarException while getting Entity from DB, actually i have few properties witch are not mapped with column names, and at loading object the system throws the Exception.

    WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL Error: 1054, SQLState: 42S22>
    ERROR [org.hibernate.util.JDBCExceptionReporter] - <Unknown column this_.cityAsString' in 'field list'>
    org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(

    My class code is like,

    @Table(name = "RETAILER")
    public class RetailerEntity extends MobexEntity implements IRetailerEntity {

    private static final long serialVersionUID = 1L;
    private Long id;
    private Long bankId;
    private String cityAsString = null;

    @Column(name = "id", nullable = false)
    public Long getId() {
    return id;
    public void setId(Long id) { = id;

    @Column(name = "BANK_ID")
    public Long getBankId() {
    return bankId;
    public void setBankId(Long bankId) {
    this.bankId = bankId;

    // UnMapped
    public String getCityAsString() {
    return cityAsString;

    public void setCityAsString(String cityAsString) {
    this.cityAsString = cityAsString;

    due scenario i can't make cityAsString as Transient.

    Kindly give me you feedback

    Kashif Bashir

    [email protected]

  • #2
    private String cityAsString = null;