use Carp qw/croak/;
+use Storable;
+
use base qw/DBIx::Class/;
__PACKAGE__->load_components(qw/AccessorGroup/);
$class = ref $class if ref $class;
my $new = bless({ %{$attrs || {}} }, $class);
$new->{resultset_class} ||= 'DBIx::Class::ResultSet';
- $new->{_ordered_columns} ||= [];
- $new->{_columns} ||= {};
- $new->{_relationships} ||= {};
+ $new->{_ordered_columns} = [ @{$new->{_ordered_columns}||[]}];
+ $new->{_columns} = { %{$new->{_columns}||{}} };
+ $new->{_relationships} = { %{$new->{_relationships}||{}} };
$new->{name} ||= "!!NAME NOT SET!!";
return $new;
}