/* 152 */ throw new EJBException("Internal error setting instance field " + getFieldName(), e);
/* */ }
/* */
/* */ public void setValueInternal(EntityEnterpriseContext ctx, Object value, boolean makeDirty)
/* */ {
/* 158 */ PersistentContext pctx = (PersistentContext)ctx.getPersistenceContext();
/* */
/* 161 */ if ((this.cmpFieldIAmMappedTo != null) && (this.cmpFieldIAmMappedTo.isPrimaryKeyMember))
/* */ {
/* 163 */ Object curValue = pctx.getFieldValue(this.rowIndex);
/* 164 */ if ((value != null) && (!value.equals(curValue)))
/* */ {
/* 166 */ throw new IllegalStateException("Attempt to modify a primary key field through a foreign key field mapped to it: " + this.entity.getEntityName() + "." + this.cmpFieldIAmMappedTo.getFieldName() + " -> " + this.entity.getQualifiedTableName() + "." + this.cmpFieldIAmMappedTo.getColumnName() + ", current value=" + curValue + ", new value=" + value);
/* */ }
/* */
/* 181 */ makeDirty = false;
/* */ }
/* */ else
/* */ {
/* 185 */ pctx.setFieldValue(this.rowIndex, value);
/* */ }
/* */
/* 188 */ if (makeDirty)
/* */ {
/* 190 */ pctx.setDirty();
/* */ }
/* */ }