I have set a one-to-many relationship between two entities. In the owner entity, I see that jhipster generator added a JsonIgnore nanotation to the one-to-many property.
If I remove the JsonIgnore annotation I am getting this runtime error :
* java.lang.instrument ASSERTION FAILED *: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 844
Is there a way to fix this error message?
Thanks in advance.
I had the same problem, and I found the solution.
Visit Collection null in AngularJS + Spring Data JPA #OneToMany #ManyToOne
I hope it helps you
Related
i have a code
<int-jpa:updating-outbound-gateway
request-channel="nativeQlChannel" auto-startup="true"
native-query="update Transactions t set t.transaction_Status = :transactionStatus where t.bank_Reference_Number = :bankReferenceNumber "
entity-manager="entityManager" persist-mode="PERSIST" reply-channel="nativeQlChannelOne"
use-payload-as-parameter-source="false">
it works fine , but as i need to execute insert operation on more than one table , and i am not able to do that by this configuration ,
how can i write code using spring integration JPA class like JpaOutboundGatewayFactoryBean , or any other so that i can perform DB operation in my java code.
First of all it isn't JPA responsibility to worry about "more than one table".
It operates only with the entities as a high level abstraction.
Although yes, you can map your entity to several tables. Plus there is cascade insert when you have dependencies.
In addition that component supports native-query/native-query if you need more graceful control for your DB operation.
As for Java configuration correct: you should use JpaOutboundGatewayFactoryBean #Bean together with the #ServiceActivator to reach similar behavior.
You can find more samples in the Reference Manual.
i am able to fix it by using
ExpressionEvaluatingParameterSourceFactory
ExpressionEvaluatingParameterSourceFactory paramFactory=new ExpressionEvaluatingParameterSourceFactory() ;
paramFactory.setParameters(paramList);
but i got exception
WARN - o.s.i.e.ExpressionUtils: Creating EvaluationContext with no beanFactory
java.lang.RuntimeException: No beanfactory
although it is not stopping any functionality . so i just ignored it.
I know it seems a stupid question, but after modelling the typical master-detail or parent-children relationship in Core Data, I want to create the NSManagedObject subclasses and I realised Core Data code generator is always using strong/retain for the parent properties. Is that right? In a normal object graph that is wrong because we have a retain cycle, but not sure in the Core Data context, because I guess the code generator should generate the code properly. Thanks for suggestions.
After trying to use weak properties in my NSManagedObject subclasses, I receive:
2016-03-15 11:57:36.921 WWWWW[84639:1153803] CoreData: error: Property 'company' is marked __weak on class 'Package'. Cannot generate a setter method for it.
2016-03-15 11:57:36.921 WWWW[84639:1153803] -[Package setCompany:]: unrecognized selector sent to instance 0x7f97917068e0
2016-03-15 11:57:36.933 WWWW[84639:1153803] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Package setCompany:]: unrecognized selector sent to instance 0x7f97917068e0'
Can you explain a "transient attribute" in Ruby on Rails?
I'm reading the factory_girl Getting Started guide and its making reference to transient attributes.
[https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md#defining-factories][1]
I understand "attribute" as an instance variables. But "transient attribute" vs. "attribute"; not so sure.
I'm new to Ruby on Rails and this would be helpful.
"A transient attribute does not get persisted to the database. For instance, in one of my models, I have a transient attribute called last_updated_by. I don't save it to the database; I just use it during the processing of the model object by the controller."
Thanks J Plato!
I have a app where my users input a HTML template with SimpleTemplateEngine notation, and execute this template with code above, in a Java Class:
new SimpleTemplateEngine().createTemplate(templateStr).make(map).toString()
and I obtain this error:
groovy.lang.GroovyRuntimeException: Could not instantiate custom Metaclass for class: java.util.ArrayList. Reason: java.lang.NoSuchMethodException: groovy.runtime.metaclass.java.util.ArrayListMetaClass.<init>(groovy.lang.MetaClass)
I observe that error occurrs in a loop in a java.util.ArrayLIst in a JPA Entity loaded by Hibernate:
<%for(int k=0; k< Registro[i].listUsers.size();k++){%>
HTML CODE
<%}%>
Anyone can help me? I no have more ideas about this error...
Thanks!
I'm guessing that the part Registro[i] is for getting the value of a static property which name is held under the variable i (or at least that is what will happen) unless the getAt(String) method has been overloaded on Registro.
Either way I also guess that returns an object that has a listUsers property that should be at least a Collection.
Maybe the problem is with the initialization of said listUsers property.
Some Registro code could be used for better understanding.
I'm using ORM Auth module and it's difficult to figure out how to do it. I've tried this case:
$user = ORM::factory('user', $id);
$user->roles->delete_all();
And got error ErrorException [ Fatal Error ]: Call to undefined method Database_Query_Builder_Delete::join()
However $user->roles->find_all(); gives me exactly what i want.
According to version 3.1.3.1 code for Kohana_ORM class, the ORM method "remove($alias, $far_keys=NULL)" if you do not pass the second parameter, it will destroy all related entries.
$user->remove('roles');
Instead of deleting roles from the database, what you want to do is remove the relationships between the user model and the roles model. You can use the ORM remove() method.
foreach ($user->roles->find_all() as $role)
{
$user->remove('roles', $role);
}
Just create a ticket for this feature. You can use a code suggested.