且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

自动生成字母数字

更新时间:2023-02-10 12:36:01

看起来你想自己生成id,这绝不是一个好主意。没有必要让id更复杂。如果您希望人们能够在上下文中传递ID,添加前缀以使其清楚它属于哪个表,则前缀很好。但即便如此,你也可以给他们一个实体。这将使所有人更容易理解。



祝你好运!
Looks like you want to generate the id's yourself which is never a good idea. There is no need to make the id's more complex then they are. A prefix is fine when you want people being able to communicate id's in context, adding the prefix to make it clear to what table it belongs. But even then you could just give them an entity. This would make it even more easier and understandable for all.

Good luck!