Index: LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm
===================================================================
--- LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm	(revision 200)
+++ LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm	(revision 201)
@@ -78,5 +78,5 @@
     $for ||= 'rw';
     my $pclass = $self->_load_obj_class($otype) or return;
-    $pclass->_canonical_fields($self, $for);
+    sort $pclass->_canonical_fields($self, $for);
 }
 
Index: LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Group.pm
===================================================================
--- LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Group.pm	(revision 200)
+++ LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Group.pm	(revision 201)
@@ -73,5 +73,6 @@
                 join group_attributes_list on
                 group_attributes_users.attr = group_attributes_list.ikey
-                where id = ? and canonical = ?
+                join "group" on "group".ikey = group_attributes_users.okey
+                where name = ? and canonical = ?
                 }
             );
@@ -106,12 +107,12 @@
                 if ($member{$_}{n}) {
                     my $sth = $self->db->prepare_cached(
-                        q{insert into group_attributes_users (value, attr, id) values (?,?,?)}
+                        q{insert into group_attributes_users (value, attr, okey) values (?,?,?)}
                     );
-                    $sth->execute($_, $attrid, $self->id);
+                    $sth->execute($_, $attrid, $self->_get_ikey);
                 } elsif ($member{$_}{c}) {
                     my $sth = $self->db->prepare_cached(
-                        q{delete from group_attributes_users where value = ? and attr = ? and id = ?}
+                        q{delete from group_attributes_users where value = ? and attr = ? and okey = ?}
                     );
-                    $sth->execute($_, $attrid, $self->id);
+                    $sth->execute($_, $attrid, $self->_get_ikey);
                 } # else {} # can't happend
             }
Index: LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm
===================================================================
--- LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm	(revision 200)
+++ LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm	(revision 201)
@@ -82,5 +82,6 @@
         my $sth = $self->db->prepare_cached(
             q{
-            select id from group_attributes_users
+            select name from "group" join
+            group_attributes_users on group_attributes_users.okey = "group".ikey
             join group_attributes_list on
             group_attributes_users.attr = group_attributes_list.ikey
@@ -91,5 +92,5 @@
         my @res;
         while (my $res = $sth->fetchrow_hashref) {
-            push(@res, $res->{id});
+            push(@res, $res->{name});
         }
         return \@res;
@@ -97,5 +98,7 @@
         my $sth = $self->db->prepare_cached(
             q{
-            select id from user_attributes join user_attributes_list
+            select uid from "user" join
+            user_attributes on user_attributes.okey = "user".ikey
+            join user_attributes_list
             on user_attributes_list.ikey = user_attributes.attr
             where value = ? and canonical = ?
@@ -105,5 +108,5 @@
         my @res;
         while (my $res = $sth->fetchrow_hashref) {
-            push(@res, $res->{id});
+            push(@res, $res->{uid});
         }
         return \@res;
@@ -111,5 +114,7 @@
         my $sth = $self->db->prepare_cached(
             q{
-            select id from group_attributes join group_attributes_list
+            select name from "group" join
+            group_attributes on group_attributes.okey = "group".ikey
+            join group_attributes_list
             on group_attributes_list.ikey = group_attributes.attr
             where value = ? and canonical = ?
@@ -119,5 +124,5 @@
         my @res;
         while (my $res = $sth->fetchrow_hashref) {
-            push(@res, $res->{id});
+            push(@res, $res->{name});
         }
         return \@res;
@@ -175,12 +180,12 @@
                 if ($member{$_}{n}) {
                     my $sth = $self->db->prepare_cached(
-                        q{insert into group_attributes_users (value, attr, id) values (?,?,?)}
+                        q{insert into group_attributes_users (value, attr, okey) values (?,?,?)}
                     );
-                    $sth->execute($self->id, $attrid, $_);
+                    $sth->execute($self->id, $attrid, $group->_get_ikey);
                 } elsif ($member{$_}{c}) {
                     my $sth = $self->db->prepare_cached(
-                        q{delete from group_attributes_users where value = ? and attr = ? and id = ?}
+                        q{delete from group_attributes_users where value = ? and attr = ? and okey = ?}
                     );
-                    $sth->execute($self->id, $attrid, $_);
+                    $sth->execute($self->id, $attrid, $group->_get_ikey);
                 } # else {} # can't happend
             }
Index: LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm
===================================================================
--- LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm	(revision 200)
+++ LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm	(revision 201)
@@ -119,5 +119,7 @@
         }
     }
-    @attr, keys %{ $class->_inline_fields($for, $base) || {} }
+    my %inl = %{ $class->_inline_fields($for, $base) || {} };
+    $inl{$_} = 1 foreach(@attr);
+    sort keys %inl;
 }
 
