Note that there are some explanatory texts on larger screens.

plurals
  1. POObject references an unsaved transient instance save the transient instance before flushing:
    text
    copied!<p><img src="https://i.stack.imgur.com/qEP51.png" alt="Relation of table"></p> <p>The diagram shown above shows relation between tables.</p> <p>The <strong>AddressType</strong> table contain static values such as <em>mailing</em>, <em>home</em>, <em>work</em> etc. </p> <p>In <strong>AddressTypeRel</strong> model class I'm having an <strong>AddressType</strong> object with annotation many to one</p> <p>AddressTypeRel.java</p> <pre><code>public class AddressTypeRel implements java.io.Serializable{ ....... private AddressType addressType=new AddressType(); ....... @ManyToOne() @LazyCollection(LazyCollectionOption.FALSE) @JoinColumn(name="typeId", insertable=false, updatable=false, nullable=false) @NotFound(action = NotFoundAction.IGNORE) public AddressType getAddressType() { return addressType; } public void setAddressType(AddressType addressType) { this.addressType = addressType; } ...... } </code></pre> <p>After saving into <strong>Address</strong> table I should also save the <em>type</em>(<em>mailing/billing</em>) of address and <em>addressId</em> into <strong>AddressTypeRel</strong> but I'm not able to save. While I try to save</p> <pre><code>AddressTypeRel addressTypeRel=new AddressTypeRel(); addressTypeRel.setAddressId(i) //i=5 for example addressTypeRel.setTypeId(j) //j=4 for example hibernatetemplate.save(addressTypeRel); </code></pre> <p>The error occuring is :</p> <blockquote> <p>object references an unsaved transient instance - save the transient instance before flushing: com.sample.AddressType</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload