You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Bernd Waibel <BW...@intarsys.de> on 2016/07/13 09:42:27 UTC

JPA Mailbox implementation missing no-arg constructors [unsigned]

Hi,

i am trying to switch to James3 in Eclipse, and there are errors reported by eclipse inside the JPA mailbox project.

"The Java class for mapped type "MailboxMessage" must define a non-private zero-argument constructor"
"The Java class for mapped type "org.apache.james.mailbox.jpa.mail.model.openjpa.AbstractJPAMailboxMessage" must define a non-private zero-argument constructor"

The JPA JSR states:
The entity class must have a no-arg constructor. The entity class may have other constructors as well. The no-arg constructor must be public or protected.
http://download.oracle.com/otndocs/jcp/persistence-2_1-fr-spec/index.html
JSR -338 Final, Release 2.1, Page 23.
So the JPA standard is very strict on this.

This no-arg constructor may not be used directly by your implementation, but may be used by e.g. copying objects between remote processes, as I understand.
This may not be true for "openjpa", I don't know.

See also: http://stackoverflow.com/questions/2808747/why-does-jpa-require-a-no-arg-constructor-for-domain-objects

Is the maintainer of the project able to define "no-arg" constructors?


Project: apache-james-mailbox-jpa
Package: org.apache.james.mailbox.jpa.mail.model.openjpa

Greetings
Bernd.



Re: JPA Mailbox implementation missing no-arg constructors [unsigned]

Posted by Benoit Tellier <be...@minet.net>.
Hi Bernd,

There is no troubles here, as these class are inherited by JPA
implementation, and thus do not need to define zero argument constructor
here.

The master branch is compiled on each commits. Moreover, unit tests and
deployment tests are successful for JPA project.

I think you might either disable the error, or pass it as a warning
(eclipse configuration do not report this on my computer).

You can propose your modification by adding a JIRA ticket for this and
opening a pull request on github
https://github.com/apache/james-project/ (or upload the patch on jira).
It will then be reviewed.

Regards,

Benoit

Le 13/07/2016  16:42, Bernd Waibel a crit :
> Hi,
> 
> i am trying to switch to James3 in Eclipse, and there are errors reported by eclipse inside the JPA mailbox project.
> 
> "The Java class for mapped type "MailboxMessage" must define a non-private zero-argument constructor"
> "The Java class for mapped type "org.apache.james.mailbox.jpa.mail.model.openjpa.AbstractJPAMailboxMessage" must define a non-private zero-argument constructor"
> 
> The JPA JSR states:
> The entity class must have a no-arg constructor. The entity class may have other constructors as well. The no-arg constructor must be public or protected.
> http://download.oracle.com/otndocs/jcp/persistence-2_1-fr-spec/index.html
> JSR -338 Final, Release 2.1, Page 23.
> So the JPA standard is very strict on this.
> 
> This no-arg constructor may not be used directly by your implementation, but may be used by e.g. copying objects between remote processes, as I understand.
> This may not be true for "openjpa", I don't know.
> 
> See also: http://stackoverflow.com/questions/2808747/why-does-jpa-require-a-no-arg-constructor-for-domain-objects
> 
> Is the maintainer of the project able to define "no-arg" constructors?
> 
> 
> Project: apache-james-mailbox-jpa
> Package: org.apache.james.mailbox.jpa.mail.model.openjpa
> 
> Greetings
> Bernd.
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org