• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

fu bace
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);

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???

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!