Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

does Hibernate support one-to-one bidirectional in subclass?

 
fu bace
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have two mapping file






if i wrote

Customer customer = (Customer)userDao.getUserById(1);
customer.getBasket();

it gives an error

00:02:36,274 ERROR JDBCExceptionReporter:101 - Unknown column 'customer1_.basket_id' in 'on clause'

if i delete the line
<one-to-one name="customer" class="com.ebazaar.customer.model.Customer" property-ref="basket" lazy="false"/>
in Basket.hbm.xml

it doesnt give any error but i cant reach from customer from basket like this.
basket = basketDao.getBasketById(1);
basket.getCustomer(); //null

Do you have any idea???

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic