- Transaction support
- Support for VARCHAR(MAX)/VARBINARY(MAX)/NVARCHAR(MAX) datatypes
- Nomalization of retrieved GUID values
+ - Added flag for correctly introspecting foreign key relationships
* Fixes
- Fix complex has_many prefetch with resultsets not selecting identity
a column accessor). For C<multi> accessors, an add_to_* method is also
created, which calls C<create_related> for the relationship.
+=item is_foreign_rel
+
+This is automatically set for all of the relationship helper methods. This is
+basically a flag that allows us to correctly introspect true foreign keys;
+or to be clear, this flag says "this relationship includes columns that point
+to another table."
+Do not confuse this with L</is_foreign_key_constraint> which serves a different
+purpose.
+
=item is_foreign_key_constraint
If you are using L<SQL::Translator> to create SQL for you and you find that it
# assume a foreign key contraint unless defined otherwise
$attrs->{is_foreign_key_constraint} = 1
if not exists $attrs->{is_foreign_key_constraint};
+
+ $attrs->{is_foreign_rel} = 1
+ if not exists $attrs->{is_foreign_rel};
$attrs->{undef_on_null_fk} = 1
if not exists $attrs->{undef_on_null_fk};
my $default_cascade = ref $cond eq 'CODE' ? 0 : 1;
+ $attrs->{is_foreign_rel} = 0
+ if not exists $attrs->{is_foreign_rel};
+
$class->add_relationship($rel, $f_class, $cond, {
accessor => 'multi',
join_type => 'LEFT',
my $default_cascade = ref $cond eq 'CODE' ? 0 : 1;
+ $attrs->{is_foreign_rel} = 0
+ if not exists $attrs->{is_foreign_rel};
+
$class->add_relationship($rel, $f_class,
$cond,
{ accessor => 'single',