You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by chintan4181 <ch...@gmail.com> on 2011/05/25 19:53:16 UTC

JEE 5: Bean Validation API and JPA 2.0

Hi,

We are running on JEE 5 stack and using JPA 2.0 for persistence layer. In
our application architecture, we have following layers Service, BC(Business
Component) and DAC(Data Access component). As per secure coding guideliens,
each layer should be responsible of doing validation. considering that
approach, Our business rule validation will be done in BC layer. and Data
type, constraint will be done in DAC layer. 

For data validation at DAC layer, i can think of Bean Validation API (JSR
303) however it's part of JEE 6. can i use in JEE 5 ?

Thanks
Chintan

--
View this message in context: http://openjpa.208410.n2.nabble.com/JEE-5-Bean-Validation-API-and-JPA-2-0-tp6403780p6403780.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: JEE 5: Bean Validation API and JPA 2.0

Posted by Kevin Sutter <kw...@gmail.com>.
One thing that will be different is that the Bean Validator provider will
come with the Java EE 6 stack (ie. WebSphere Application Server v8).  So, if
you installed a BV provider as a shared library or packaged it with your
application, you'll probably want to remove that configuration and just use
the one that comes with the WebSphere V8 deliverable.

Thanks,
Kevin

On Wed, May 25, 2011 at 3:53 PM, chintan4181 <ch...@gmail.com> wrote:

> Thanks Kevin, Jeremy.
>
> One more question. If i use OSGi/JPA 2.0 feature pack with Apache Bean
> Validation in Websphere  7.0 and in future if i migrate to JEE 6, are there
> any migration issue in terms of Bean Validation usage?
>
> Chintan
>
>
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/JEE-5-Bean-Validation-API-and-JPA-2-0-tp6403780p6404442.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Re: JEE 5: Bean Validation API and JPA 2.0

Posted by chintan4181 <ch...@gmail.com>.
Hi,

Thanks for the information. I have one question. If I use Hibernate
Validator (which implements JSR 303) in my WAS 7.0 and when i migrate to WAS
8.0. Do I need to do any code change?

Thanks
Chintan

--
View this message in context: http://openjpa.208410.n2.nabble.com/JEE-5-Bean-Validation-API-and-JPA-2-0-tp6403780p6611836.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: JEE 5: Bean Validation API and JPA 2.0

Posted by Jeremy Bauer <te...@gmail.com>.
Hi Chintan,

The WebSphere Version 8 Beta documentation in the IBM infocenter has a
good writeup on migration considerations for bean validation[1] when
moving to a full EE6 app server.  The short answer is that you'll no
longer need to set a system property to point to the validation API
and you'll no longer have to include a bean validation provider in
your application or shared library.  The application server will
provide both the API classes and a default provider.  The easiest way
to verify your application continues to work the full EE 6 environment
may be to download the V8 beta[2] and give it a try.

-Jeremy

[1] http://publib.boulder.ibm.com/infocenter/wasinfo/beta/topic/com.ibm.websphere.nd.doc/info/ae/ae/cdat_beanvaljpamigration.html

[2] https://www14.software.ibm.com/iwm/web/cc/earlyprograms/websphere/wsasoa/index.shtml

On Wed, May 25, 2011 at 3:53 PM, chintan4181 <ch...@gmail.com> wrote:
> Thanks Kevin, Jeremy.
>
> One more question. If i use OSGi/JPA 2.0 feature pack with Apache Bean
> Validation in Websphere  7.0 and in future if i migrate to JEE 6, are there
> any migration issue in terms of Bean Validation usage?
>
> Chintan
>
>
>
> --
> View this message in context: http://openjpa.208410.n2.nabble.com/JEE-5-Bean-Validation-API-and-JPA-2-0-tp6403780p6404442.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Re: JEE 5: Bean Validation API and JPA 2.0

Posted by chintan4181 <ch...@gmail.com>.
Thanks Kevin, Jeremy. 

One more question. If i use OSGi/JPA 2.0 feature pack with Apache Bean
Validation in Websphere  7.0 and in future if i migrate to JEE 6, are there
any migration issue in terms of Bean Validation usage?

Chintan



--
View this message in context: http://openjpa.208410.n2.nabble.com/JEE-5-Bean-Validation-API-and-JPA-2-0-tp6403780p6404442.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: JEE 5: Bean Validation API and JPA 2.0

Posted by Jeremy Bauer <te...@gmail.com>.
Chintan,

While Bean Validation is one of the Java EE 6 specifications, each
provider will have its own Java SE version requirements.  For example,
Apache BVAL[1] can be used with Java SE 1.5.  Some/most Java EE 5
application servers will most likely allow you to use a "Java 1.5
compatible" Bean Validation provider using JSE-style APIs.  You'll
lack EE6 features like JNDI lookup of validation factories and
integration with other technologies such as JPA, JSF, and JCA.

An exception is that the WebSphere Version 7.0 Feature Pack for
OSGi/JPA 2.0 provides a mechanism to support bean validation
integration with JPA 2.0 in an EE 5 + JPA 2.0 environment.  If you are
interested, I wrote up a blog post several months ago that provides a
step-by-step procedure to do the enablement.[2]  It is a bit out of
date as far as versions go, though.  You'll want to use the new 0.3
version of BVAL instead 0.1.

-Jeremy

[1] http://incubator.apache.org/bval/cwiki/index.html
[2]http://webspherepersistence.blogspot.com/2010/07/using-bean-validation-with-osgijpa-20.html

On Wed, May 25, 2011 at 12:53 PM, chintan4181 <ch...@gmail.com> wrote:
> Hi,
>
> We are running on JEE 5 stack and using JPA 2.0 for persistence layer. In
> our application architecture, we have following layers Service, BC(Business
> Component) and DAC(Data Access component). As per secure coding guideliens,
> each layer should be responsible of doing validation. considering that
> approach, Our business rule validation will be done in BC layer. and Data
> type, constraint will be done in DAC layer.
>
> For data validation at DAC layer, i can think of Bean Validation API (JSR
> 303) however it's part of JEE 6. can i use in JEE 5 ?
>
> Thanks
> Chintan
>
> --
> View this message in context: http://openjpa.208410.n2.nabble.com/JEE-5-Bean-Validation-API-and-JPA-2-0-tp6403780p6403780.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Re: JEE 5: Bean Validation API and JPA 2.0

Posted by Kevin Sutter <kw...@gmail.com>.
Hi Chintan,
Yes, Bean Validation can be used in a Java EE 5 environment, but it would be
used in an application-managed mode.  That is, Java EE 5 from an application
server or container perspective would have no knowledge of how to interact
with Bean Validation.  But, if your application is calling out to the Bean
Validator, that should work just fine.

As proof of this approach, WebSphere provides the OSGi/JPA 2.0 Feature Pack
that sits on top of WebSphere Application Server v7.  Although this Feature
Pack does not ship a Bean Validator provider, we do document how a customer
could get their own provider [1] and use it with our JPA 2.0 solution [2].

Hope this helps,
Kevin

[1]  http://incubator.apache.org/bval/cwiki/index.html
[2]
http://publib.boulder.ibm.com/infocenter/wasinfo/fep/topic/com.ibm.websphere.jpafep.multiplatform.doc/info/ae/ae/tejb_jpabeanval.html

On Wed, May 25, 2011 at 12:53 PM, chintan4181 <ch...@gmail.com> wrote:

> Hi,
>
> We are running on JEE 5 stack and using JPA 2.0 for persistence layer. In
> our application architecture, we have following layers Service, BC(Business
> Component) and DAC(Data Access component). As per secure coding guideliens,
> each layer should be responsible of doing validation. considering that
> approach, Our business rule validation will be done in BC layer. and Data
> type, constraint will be done in DAC layer.
>
> For data validation at DAC layer, i can think of Bean Validation API (JSR
> 303) however it's part of JEE 6. can i use in JEE 5 ?
>
> Thanks
> Chintan
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/JEE-5-Bean-Validation-API-and-JPA-2-0-tp6403780p6403780.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>