File: Product.pm

package info (click to toggle)
librose-db-object-perl 1%3A0.815-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,048 kB
  • sloc: perl: 79,670; sql: 28; makefile: 7
file content (63 lines) | stat: -rwxr-xr-x 1,246 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package MyTest::RDBO::Complex::Product;

use strict;

use MyTest::RDBO::Complex::Code;
use MyTest::RDBO::Complex::Category;

use Rose::DB::Object;
our @ISA = qw(Rose::DB::Object);

__PACKAGE__->meta->table('rose_db_object_test_products');

__PACKAGE__->meta->columns
(
  id            => { type => 'serial', primary_key => 1 },
  name          => { type => 'varchar' },
  category_id   => { type => 'integer' },
  status        => { type => 'varchar' },
  fk1           => { type => 'integer' },
  fk2           => { type => 'integer' },
  fk3           => { type => 'integer' },
  published     => { type => 'datetime' },
  last_modified => { type => 'datetime' },
  date_created  => { type => 'datetime' },
);

__PACKAGE__->meta->foreign_keys
(
  category =>
  {
    class => 'MyTest::RDBO::Complex::Category',
    key_columns =>
    {
      category_id => 'id',
    }
  },

  code =>
  {
    class => 'MyTest::RDBO::Complex::Code',
    key_columns =>
    {
      fk1 => 'k1',
      fk2 => 'k2',
      fk3 => 'k3',
    }
  }
);

__PACKAGE__->meta->relationships
(
  code_names =>
  {
    type  => 'one to many',
    class => 'MyTest::RDBO::Simple::CodeName',
    column_map => { id => 'product_id' },
  }
);


__PACKAGE__->meta->initialize;

1;