Question - How can I create an association to an entity without fetching that entity from the database (if I know the identifier)?
Answer -
If the entity is proxyable (lazy="true"), simply use load(). The following code does not result in any SELECT statement:
Item itemProxy = (Item) session.load(Item.class, itemId);Bid bid = new Bid(user, amount, itemProxy);session.save(bid);