In ADF 12c when we want to have transient expression in entity object for example primary key of Entity object is coming from DB sequence then we declare the expression as shown in below
(new oracle.jbo.server.SequenceImpl("SEQUENCE_NAME", adf.object.getDBTransaction())).getSequenceNumber()
After this if you compile the project you get below error
Error(10,1): [Static type checking] - [ADF security error] Calling the constructor for class oracle.jbo.server.SequenceImpl is not permitted.
 @ line 10, column 1.
Which means that the entity is not trusted the expression changes. To solve this follow below steps
1.Go to the source of the entity object xml file
2. go to "TransientExpression" of the attribute which you are adding expression as shown in screenshot below
3.Check the value of the attribute "trustMode"
4.By default it is "untrusted", change it to "trusted" or remove it
Now recompile the project. Compiler issue doesn't occur
hope this helps