开发者

Grails, making sure that map is unique

开发者 https://www.devze.com 2023-03-03 14:39 出处:网络
:D I have this map: [channel:Provider] How do I make sure that the map (and I mean, the pairing of channel + Provider) become unique? Is there a super easy way to do that? Or should I create a cust

:D I have this map:

[channel:Provider]

How do I make sure that the map (and I mean, the pairing of channel + Provider) become unique? Is there a super easy way to do that? Or should I create a custom valid开发者_开发百科ator for it.. T__T I think I can add a unique constraint to the table that contains both columns, but I'm a bit new to grails, this GORM thing is preventing me from acting out my thoughts.


All maps guarantee that that the pairing of key and value is unique, because you can't have duplicate keys. It seems that either I'm misunderstanding what you want to achieve, or you're misunderstanding how maps work.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号