in Java I have a long
value that I send to the server and I want to store it per Symfony2 / Doctrine2 in a mysql db.
在Java中我有一个很长的值,我发送到服务器,我想将它存储在一个mysql数据库中Symfony2 / Doctrine2。
PHP_INT_MAX might only be 2147483647 (different systems, might be 32bit only) and in MySql I think BIGINT should be used.
PHP_INT_MAX可能只是2147483647(不同的系统,可能只有32位)而在MySql中我认为应该使用BIGINT。
What's the best way for accomplishing that, can someone provide an example entity-declaration?
实现这一目标的最佳方式是什么,有人可以提供示例实体声明吗?
Thanks! :)
1 个解决方案
#1
2
You can check the data types in Doctrine in here: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/basic-mapping.html
您可以在此处查看Doctrine中的数据类型:http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/basic-mapping.html
There is bigint
type that you can use:
你可以使用bigint类型:
bigint: Type that maps a database BIGINT to a PHP string.
#1
2
You can check the data types in Doctrine in here: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/basic-mapping.html
您可以在此处查看Doctrine中的数据类型:http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/basic-mapping.html
There is bigint
type that you can use:
你可以使用bigint类型:
bigint: Type that maps a database BIGINT to a PHP string.