my (@ids, @missing);
- for ($self->_pri_cols) {
+ for ($self->result_source->_pri_cols_or_die) {
push @ids, ($use_storage_state and exists $self->{_column_data_in_storage}{$_})
? $self->{_column_data_in_storage}{$_}
: $self->get_column($_)
sub _mk_ident_cond {
my ($self, $alias, $use_storage_state) = @_;
- my @pks = $self->_pri_cols;
+ my @pks = $self->result_source->_pri_cols_or_die;
my @vals = $self->_ident_values($use_storage_state);
my (%cond, @undef);
# fixup the code a bit to make things saner, but ideally 'filter' needs to
# be deprecated ASAP and removed shortly after
# Not doing so before 0.08250 however, too many things in motion already
- my ($pk_col, @rest) = $val->_pri_cols;
+ my ($pk_col, @rest) = $val->result_source->_pri_cols_or_die;
$self->throw_exception(
"Relationship '$rel' of type 'filter' can not work with a multicolumn primary key on source '$f_class'"
) if @rest;
# no join condition or just a column name
if (!ref $cond) {
$class->ensure_class_loaded($f_class);
- my %f_primaries = map { $_ => 1 } try { $f_class->_pri_cols }
+ my %f_primaries = map { $_ => 1 } try { $f_class->result_source_instance->_pri_cols_or_die }
catch {
$class->throw_exception( "Can't infer join condition for '$rel' on ${class}: $_");
};
unless (ref $cond) {
$class->ensure_class_loaded($f_class);
- my ($pri, $too_many) = try { $class->_pri_cols }
+ my ($pri, $too_many) = try { $class->result_source_instance->_pri_cols_or_die }
catch {
$class->throw_exception("Can't infer join condition for '$rel' on ${class}: $_");
};
sub _get_primary_key {
my ( $class, $target_class ) = @_;
$target_class ||= $class;
- my ($pri, $too_many) = try { $target_class->_pri_cols }
+ my ($pri, $too_many) = try { $target_class->result_source_instance->_pri_cols_or_die }
catch {
$class->throw_exception("Can't infer join condition on ${target_class}: $_");
};
# a helper method that will automatically die with a descriptive message if
# no pk is defined on the source in question. For internal use to save
# on if @pks... boilerplate
-sub _pri_cols {
+sub _pri_cols_or_die {
my $self = shift;
my @pcols = $self->primary_columns
or $self->throw_exception (sprintf(
set_primary_key
primary_columns
- _pri_cols
sequence
add_unique_constraint
my ($self, $source, $blob_cols, $where) = @_;
my @primary_cols = try
- { $source->_pri_cols }
+ { $source->_pri_cols_or_die }
catch {
$self->throw_exception("Cannot update TEXT/IMAGE column(s): $_")
};
my %row = %$row;
my @primary_cols = try
- { $source->_pri_cols }
+ { $source->_pri_cols_or_die }
catch {
$self->throw_exception("Cannot update TEXT/IMAGE column(s): $_")
};