package MyApp::ClassTableInheritance::Schema::Base::Result::Player; use namespace::autoclean; use Moose; use MooseX::NonMoose; use MooseX::Types::UUID qw(UUID); extends qw( DBIx::Class::Core ); __PACKAGE__->load_components(qw( UUIDColumns )); # **************************************************************** # table setting(s) # **************************************************************** # It is overwritten with concrete classes. __PACKAGE__->table('__PLACEHOLDER__'); __PACKAGE__->add_columns( id => { data_type => 'char', size => 36, is_foreign_key => 1, }, ); # Or, use DBIx::Class::MooseColumns with ( 'MyApp::Role::Schema::Result::Validatable' => { columns => { id => { isa => UUID }, }, }, ); sub _prepare_table { my ($class) = @_; $class->set_primary_key(qw(id)); $class->uuid_columns(qw(id)); return; } # **************************************************************** # business logic(s) # **************************************************************** sub salute { my ($self) = @_; printf( "Hello, my name is %s.\n", $self->name, ); } # **************************************************************** # compile-time process(es) # **************************************************************** __PACKAGE__->_prepare_table; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding utf-8 =head1 NAME MyApp::ClassTableInheritance::Schema::Base::Result::Player - blah blah blah =head1 SYNOPSIS # yada yada yada =head1 DESCRIPTION blah blah blah =head1 AUTHOR =over 4 =item MORIYA Masaki, alias Gardejo C<< >>, L =back =head1 COPYRIGHT AND LICENSE Copyright (c) 2010 MORIYA Masaki, alias Gardejo. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L and L. The full text of the license can be found in the F file included with this distribution. =cut