Hi Jeroen, I've used that already, but I have failed thru 2000 chars
restriction.

Regs,Vladimir

2015-10-07 9:46 GMT+02:00 Jeroen van der Wal <jer...@stromboli.it>:

> For long text fields I use this pattern:
>
> private String myLongTextField;
>
> @javax.jdo.annotations.Column(allowsNull="true", jdbcType="CLOB",
> sqlType="LONGVARCHAR")
> public String getMyLongTextField() {
>     return myLongTextField;
> }
>
> public void setMyLongTextField(final String myLongTextField) {
>     this.myLongTextField = myLongTextField;
> }
>
> HTH
>
> Jeroen
>
> On 6 October 2015 at 16:49, Vladimir Nišević <vnise...@gmail.com> wrote:
>
> > Hi Dan, that is also absolutely fine for me!
> >
> > Many thanks!
> > Vladimir
> >
> >
> > > Am 06.10.2015 um 16:39 schrieb Dan Haywood <
> d...@haywood-associates.co.uk
> > >:
> > >
> > > Hmm, sounds like a new requirement.  The idea of CLOB really is to
> > > represent documents, not for direct editing.
> > >
> > > As a workaround, could you define a derived non-persisted property and
> > have
> > > it update the clob, eg:
> > >
> > > @PropertyLayout(multiLine=20)
> > > @javax.jdo.annotations.NotPersistent
> > > public String getText() {
> > >    return getClob().getChars().toString();
> > > }
> > > public void setText(String text) {
> > >    setClob(new Clob(..., ..., text);  // whatever
> > > }
> > >
> > > private Clob clob;
> > > @javax.jdo.annotations.Persistent
> > > public Clob getClob() { ... }
> > > public void setClob(Clob clob) { ... }
> > >
> > >
> > > if using actions, then similarly:
> > >
> > > public void updateText(@ParameterLayout(multiLine=20) String text) {
> > >    setClob(...);
> > > }
> > > public String default0UpdateText() { return
> > > getClob().getChars().toString(); }
> > >
> > >
> > > HTH
> > > Dan
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >> On 6 October 2015 at 15:32, Vladimir Nišević <vnise...@gmail.com>
> > wrote:
> > >>
> > >> Hi, would it be possible to edit a property defined as CLOB in
> database
> > and
> > >> as Clob custom value type direclty in a wicket multiline text field?
> > >>
> > >> I have sometimes strings longer than 2000 chars and must store them as
> > >> CLOB, on the other side I loose the feature to edit them in Wicket
> > viewer.
> > >>
> > >> Regards
> > >> Vladimir
> > >>
> >
>

Reply via email to