On Sat, 2022-10-29 at 09:46 +0000, 'Mark Raynsford' via H2 Database wrote: > I'm slightly confused as to how to represent a particular data > structure efficiently. It's pretty simple, so I'll describe it in > terms > of SQL: > > create table t ( > group integer not null, > member integer not null, > primary key (group, member) > ); > > I think the natural way this would be expressed as a plain Java data > structure would be: > > Map<Integer, Set<Integer>>
Greetings, based on your PRIMARY KEY it would be MAP<Key, T> with a Class Key ( int group, int member ) and a class T (int group, int member). If group represents the key, and member represents the object, then PRIMARY KEY(group) and MAP<Integer, Integer>. Best regards Andreas -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/h2-database/0f147504216fdd15e90ded31cabaad56a98cecce.camel%40manticore-projects.com.
