package TestApp::DB::Object::Product; use strict; use base qw(TestApp::DB::Object);
__PACKAGE__->meta->setup ( table => 'PRODUCTS',
columns => [ ID => { type => 'scalar', alias => 'id', length => 38, not_null => 1 }, NAME => { type => 'scalar', alias => 'name', length => 255, not_null => 1 }, STATUS => { type => 'scalar', alias => 'status', default => 'inactive', length => 128, not_null => 1 }, DATE_CREATED => { type => 'scalar', alias => 'date_created', default => 'sysdate', length => 11 }, RELEASE_DATE => { type => 'scalar', alias => 'release_date', length => 11 }, VENDOR_ID => { type => 'scalar', alias => 'vendor_id', length => 38 }, ],
primary_key_columns => [ 'ID' ], ); 1;
Also, it doesn't seem to be detecting unique indices as well. I have a unique index defined on the 'name' column but as you can see 'unique_key => name' isn't part of the output.
I've scoured the docs (as well as this group) for the answer but to no avail.
I don't have access to Oracle 10g here, but if you can throw a
breakpoint into auto_generate_column() in
Rose::DB::Object::Metadata::Auto and see what value $type and
$column_class end up with, that might get you started debugging it.
Just for other's sake....because Rose::DB::Object::Metadata doesn't support varchar2 out of the box, I had to add the following method to my Metadata subclass :
As for my INTEGER field, DBD Oracle returns 'NUMBER' type for any defined numeric columns in Oracle. According to the DBD::Oracle POD this is because Oracle only supports NUMBER fields but does support other numeric fields as aliases.
Would I be losing any resolution if I just left NUMBER columns as default scalars (as are ID and VENDOR_ID in my table example above)? Or should I bother in trying to map these columns manually with actual Rose::DB::Object::Metadata::Column types?
On Mon, Jul 30, 2012 at 10:36 AM, Chris <ccamp...@gmail.com> wrote:
> Just for other's sake....because Rose::DB::Object::Metadata doesn't support
> varchar2 out of the box, I had to add the following method to my Metadata
> subclass :
> As for my INTEGER field, DBD Oracle returns 'NUMBER' type for any defined
> numeric columns in Oracle. According to the DBD::Oracle POD this is because
> Oracle only supports NUMBER fields but does support other numeric fields as
> aliases.
What do you think about mapping number to the
Rose::DB::Object::Metadata::Column::Numeric column type?
> Would I be losing any resolution if I just left NUMBER columns as default
> scalars (as are ID and VENDOR_ID in my table example above)? Or should I
> bother in trying to map these columns manually with actual
> Rose::DB::Object::Metadata::Column types?
I think you should be fine with them as scalar, but maybe
Rose::DB::Object::Metadata::Column::BigInt might be required for very
large integer values. Test it out with very large values and tell me
if the scalar type works for you.
I like the idea of mapping number to Rose::DB::Object::Metadata::Column::Numeric, since I'm currently running into this problem as well (I'm trying to build a validation profile, so I need to know the datatype of this column numeric). I noticed it's already in Rose::DB::Object::Metadata, but just commented out.
On Friday, August 10, 2012 9:24:23 AM UTC-4, John Siracusa wrote:
> On Mon, Jul 30, 2012 at 10:36 AM, Chris wrote: > > Just for other's sake....because Rose::DB::Object::Metadata doesn't > support > > varchar2 out of the box, I had to add the following method to my > Metadata > > subclass :
> > As for my INTEGER field, DBD Oracle returns 'NUMBER' type for any > defined > > numeric columns in Oracle. According to the DBD::Oracle POD this is > because > > Oracle only supports NUMBER fields but does support other numeric fields > as > > aliases.
> What do you think about mapping number to the > Rose::DB::Object::Metadata::Column::Numeric column type?
> > Would I be losing any resolution if I just left NUMBER columns as > default > > scalars (as are ID and VENDOR_ID in my table example above)? Or should > I > > bother in trying to map these columns manually with actual > > Rose::DB::Object::Metadata::Column types?
> I think you should be fine with them as scalar, but maybe > Rose::DB::Object::Metadata::Column::BigInt might be required for very > large integer values. Test it out with very large values and tell me > if the scalar type works for you.
On Wed, Sep 26, 2012 at 4:24 PM, Tom Adamo <tad...@gmail.com> wrote:
> I like the idea of mapping number to
> Rose::DB::Object::Metadata::Column::Numeric, since I'm currently running
> into this problem as well (I'm trying to build a validation profile, so I
> need to know the datatype of this column numeric). I noticed it's already in
> Rose::DB::Object::Metadata, but just commented out.
Just the "number" type name is commented out (and I'm not sure why).
You should be able to use the "numeric" or "num" type names to get the
same result.
On Wednesday, September 26, 2012 4:40:46 PM UTC-4, John Siracusa wrote:
> On Wed, Sep 26, 2012 at 4:24 PM, Tom Adamo <tad...@gmail.com <javascript:>> > wrote: > > I like the idea of mapping number to > > Rose::DB::Object::Metadata::Column::Numeric, since I'm currently running > > into this problem as well (I'm trying to build a validation profile, so > I > > need to know the datatype of this column numeric). I noticed it's > already in > > Rose::DB::Object::Metadata, but just commented out.
> Just the "number" type name is commented out (and I'm not sure why). > You should be able to use the "numeric" or "num" type names to get the > same result.