[forge-dev] Add means of defining constraint for Length on String

Robb Greathouse robb.greathouse at redhat.com
Fri Sep 13 11:13:36 EDT 2013


I was told that it was on the roadmap and was going to be added. Don't know if it happened. 

Robb Greathouse 
Partner Enablement 
Middleware Business Unit 
JBoss, a Division of Red Hat 
cellphone 505-507-4906 

----- Original Message -----

> Hi all,

> I am trying to do exactly the same : generate an entity with a @Column
> (length=2000). Looks like it is still not possible. Am I right ? If I do :

> field string --named title ;
> constraint Size --onProperty title --max 2000

> I get :

> @Column
> @Size(max = 2000)
> private String title;

> Even in Java EE 7, the integration between JPA and Bean Validation hasn't
> been made. So this doesn't work (i.e. create a column in the DB with 2000
> char long). What I would need is :

> @Column(length = 2000)
> @Size(max = 2000)
> private String title;

> Looks like it's not doable, but I might be wrong.

> Thanks

> 2012/12/29 George Gastaldi < gegastaldi at icloud.com >

> > Change the value in your @Column annotation. Thats JPA Standard.
> 

> > George Gastaldi
> 

> > Em 28/12/2012, às 20:17, Robb Greathouse < robb.greathouse at jboss.com >
> > escreveu:
> 

> > > Hi,
> 
> > >
> 
> > > Was trying to change the length on String from the VarChar(255). In
> > > Hibernate this can be done by specifying @Length(max=350) (for example.
> 
> > >
> 
> > > However, there is no "constraint Length --onProperty xxx --max 350"
> > > available in Forge.
> 
> > >
> 
> > > Using "constraint Max" causes forge to have a conversion error when
> > > attempting to insert string data.
> 
> > >
> 
> > > Robb Greathouse
> 
> > > Partner Enablement
> 
> > > Middleware Business Unit
> 
> > > JBoss, a Division of Red Hat
> 
> > > cellphone 505-507-4906
> 
> > >
> 

> > _______________________________________________
> 
> > forge-dev mailing list
> 
> > forge-dev at lists.jboss.org
> 
> > https://lists.jboss.org/mailman/listinfo/forge-dev
> 

> --
> Antonio Goncalves
> Software architect and Java Champion

> Web site | Twitter | LinkedIn | Paris JUG | Devoxx France
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-dev/attachments/20130913/b76e3435/attachment.html 


More information about the forge-dev mailing list