Best (most efficient) DataType to use for UUIDs as JPA IDs
问题 I want to use UUIDs as IDs for my JPA Objects. I am currently just using a String to store the UUID. What would be more efficient? 回答1: How are you measuring efficiency? For example, storing the UUID (which is a text encoding of a byte[] ) as a couple of long values will allow you to compare them very quickly on a 64-bit architecture (much more quickly than String comparison, which is character-by-character). However, your coding efficiency would suffer, because you have to write a custom