ORM Generation: "insertable" and "updatable"

Hello,

actually, we had a problem with “insertable” and “updatable” properties annotation.
Here is the following code which pose problem: “@JoinColumns({ @JoinColumn(name=“DispositionActionsID”, referencedColumnName=“ID”, insertable=false, updatable=false) })”

So the question is, why those two properties are always set to false? As a consequence we cannot add records to our database.
Is it possible to configure them?

Thank you for your understanding,

Hi Ado,

Thanks for your post. This is because the column “DispositionActionsID” is referencing the column “ID” of other table, which the value cannot be inserted or updated manually (as they are PK of other table). If there is any further inquiry, please do not hesitate to ask.

Best regards,
Lilian Wong

Hi LilianWong,

Ok for your explanations, let’s take a concrete example. Indeed, the problem is the following: DispositionsActions is a table which is referenced in RecordClassIGP table. As a matter of fact, when I try to add a record to RecordClassIGP table, I can’t whereas DispositionsAction table contains records. However, if “insertable” is set to true then I can do my insertion.

So I’d like to insert a row in RecordClassIGP in referencing a specific record of DispositionsActions table.
Why I can’t do it?

	/* Disposition Action */
	DispositionActions dispositionAction = null;
	if (recordClassIGPDTO.getDispositionAction() != null) {
		String condition = "Name = '"+ recordClassIGPDTO.getDispositionAction() + "'";
		DispositionActionsDAO dispositionActionsDAO = lDAOFactory.getDispositionActionsDAO();
		dispositionAction = dispositionActionsDAO.loadDispositionActionsByQuery(condition, null);
		recordClassIGP.setDispositionActions(dispositionAction);
	}

Then I do: recordClassIGPDAO.save(recordClassIGP); and an exception is raised.

Hi Ado,

Thanks for replying. Would you mind to attach your project file for investigation? Thanks in advance!

Best regards,
Lilian Wong