java - Hibernate entity virtual column error? -
i have defined virtual column distanceinkm in entity distance calculation , giving response user along distanceinkm virtual column not column in table,and it's working (case 1) . now using same entity fetching values table getting com.mysql.jdbc.exceptions.jdbc4.mysqlsyntaxerrorexception: unknown column 'restaurant0_.distanceinkm' in 'field list' . (case 2) i came know usage of @transiant annotation virtual columns used calculation.but if using virtual column not serialized/added user response in (case 1) .i need implement both api ie , case 1 & case 2 using 1 entity @entity @table(name = "restaurants") public class restaurants implements serializable { private static final long serialversionuid = 1l; @id @generatedvalue(strategy = generationtype.identity) @column(name = "restaurant_id") private int restaurantid; @column(name = "restaurant_name") pr...