Scaffolding - bugs?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Scaffolding - bugs?

Marc Palmer Local
hi all,

Just building some prototype domain classes and using scaffolding for  
data entry etc.

1. I have "int" properties and no field appears in the scaffolded  
"create" form.

2. How do you apply the Hibernate constraints to Date properties so  
that they become DATE or TIME (as opposed to TIMESTAMP) fields, in  
such a way that this constraint info is available to Grails also? I  
can't see anything in the user guide for this.

Cheers



~ ~ ~
Marc Palmer ([hidden email])
Consultant/Analyst
AnyWare Ltd.
http://www.anyware.co.uk/


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Scaffolding - bugs?

graemer
On 6/26/06, Marc Palmer <[hidden email]> wrote:
> hi all,
>
> Just building some prototype domain classes and using scaffolding for
> data entry etc.
>
> 1. I have "int" properties and no field appears in the scaffolded
> "create" form.
Hmm it seems we are not handling primitives properly, you can use
Integer as there is no real difference as far as groovy is concerned
and then raise an issue to fix primitive support

>
> 2. How do you apply the Hibernate constraints to Date properties so
> that they become DATE or TIME (as opposed to TIMESTAMP) fields, in
> such a way that this constraint info is available to Grails also? I
> can't see anything in the user guide for this.
There is no way to force this, there are two things I can suggest. You
can either create your own SQL script to populate your database with
the correct types (as you have to do with Rails for example) or you
can try changing the type of your Date class to java.sql.Date.. I've
never tried it but it might have the desired effect

Graeme

>
> Cheers
>
>
>
> ~ ~ ~
> Marc Palmer ([hidden email])
> Consultant/Analyst
> AnyWare Ltd.
> http://www.anyware.co.uk/
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Scaffolding - bugs?

graemer
On 6/26/06, Graeme Rocher <[hidden email]> wrote:

> On 6/26/06, Marc Palmer <[hidden email]> wrote:
> > hi all,
> >
> > Just building some prototype domain classes and using scaffolding for
> > data entry etc.
> >
> > 1. I have "int" properties and no field appears in the scaffolded
> > "create" form.
> Hmm it seems we are not handling primitives properly, you can use
> Integer as there is no real difference as far as groovy is concerned
> and then raise an issue to fix primitive support
>
> >
> > 2. How do you apply the Hibernate constraints to Date properties so
> > that they become DATE or TIME (as opposed to TIMESTAMP) fields, in
> > such a way that this constraint info is available to Grails also? I
> > can't see anything in the user guide for this.
> There is no way to force this, there are two things I can suggest. You
> can either create your own SQL script to populate your database with
> the correct types (as you have to do with Rails for example) or you
> can try changing the type of your Date class to java.sql.Date.. I've
> never tried it but it might have the desired effect

Sorry the type of the property you have to java.sql.Date, and I guess
if you want TIME it would be java.sql.Time

Graeme

>
> Graeme
>
> >
> > Cheers
> >
> >
> >
> > ~ ~ ~
> > Marc Palmer ([hidden email])
> > Consultant/Analyst
> > AnyWare Ltd.
> > http://www.anyware.co.uk/
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list please visit:
> >
> >     http://xircles.codehaus.org/manage_email
> >
> >
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Scaffolding - bugs?

Marc Palmer Local
>
> Sorry the type of the property you have to java.sql.Date, and I guess
> if you want TIME it would be java.sql.Time

Ha, of course. Sorry Graeme - thanks for the info. A little info on  
this in the ORM doc (a general bit of info about common types and  
handling) would be useful. Hibernate 3 with annotations has support  
for using java.util.Date but using an annotation to coerce strictly  
to DATE, TIME or TIMESTAMP.

Hence I wondered if there was a constraint or similar mechanism for  
this.

Cheers


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Scaffolding - bugs?

Marc Palmer Local
In reply to this post by graemer

On 26 Jun 2006, at 21:36, Graeme Rocher wrote:

> On 6/26/06, Marc Palmer <[hidden email]> wrote:
>> hi all,
>>
>> Just building some prototype domain classes and using scaffolding for
>> data entry etc.
>>
>> 1. I have "int" properties and no field appears in the scaffolded
>> "create" form.
> Hmm it seems we are not handling primitives properly, you can use
> Integer as there is no real difference as far as groovy is concerned
> and then raise an issue to fix primitive support

Do you want me to raise an issue for this in Jira or will you do it?

Cheers


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Scaffolding - bugs?

graemer
On 6/26/06, Marc Palmer <[hidden email]> wrote:

>
> On 26 Jun 2006, at 21:36, Graeme Rocher wrote:
>
> > On 6/26/06, Marc Palmer <[hidden email]> wrote:
> >> hi all,
> >>
> >> Just building some prototype domain classes and using scaffolding for
> >> data entry etc.
> >>
> >> 1. I have "int" properties and no field appears in the scaffolded
> >> "create" form.
> > Hmm it seems we are not handling primitives properly, you can use
> > Integer as there is no real difference as far as groovy is concerned
> > and then raise an issue to fix primitive support
>
> Do you want me to raise an issue for this in Jira or will you do it?

Would be great if you could :-)

Graeme

>
> Cheers
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email