首页Home › 开发工具Developer Tools

🗃️ SQL 建表语句转 Java 实体类SQL (CREATE TABLE) to Java Entity

把 SQL CREATE TABLE 语句转换为 Java 实体类(POJO),自动映射字段类型,下划线转驼峰。Convert a SQL CREATE TABLE statement into a Java entity class (POJO), mapping types and snake_case to camelCase.

使用说明与常见问题How-to & FAQ

「SQL 建表语句转 Java 实体类」是什么?What is the SQL (CREATE TABLE) to Java Entity tool?

把 SQL CREATE TABLE 语句转换为 Java 实体类(POJO),自动映射字段类型,下划线转驼峰。Convert a SQL CREATE TABLE statement into a Java entity class (POJO), mapping types and snake_case to camelCase.

如何使用「SQL 建表语句转 Java 实体类」?How do I use the SQL (CREATE TABLE) to Java Entity tool?

在「SQL 建表语句转 Java 实体类」中,把内容粘贴或输入到上方输入框,结果会实时显示在下方,点击「复制结果」即可复制。In the SQL (CREATE TABLE) to Java Entity: Paste or type into the input box; the result appears below instantly — click "Copy result" to copy it.

支持哪些 SQL 方言?Which SQL dialects are supported?

支持 MySQL、PostgreSQL、SQL Server 常见 CREATE TABLE 写法,包括带库名/架构名(schema.table、[dbo].[t])和反引号、双引号、方括号标识符;一次可转换多个表。约束行(主键、索引、外键等)会被跳过。Common MySQL, PostgreSQL and SQL Server CREATE TABLE syntax is supported, including schema-qualified names (schema.table, [dbo].[t]) and backtick, double-quote and bracket identifiers; several tables can be converted at once. Constraint lines (primary key, index, foreign key) are skipped.

类型如何映射?How are types mapped?

例如 serial → Integer、bigserial / bigint → Long、int unsigned → Long、bigint unsigned → BigInteger、timestamptz / datetimeoffset → OffsetDateTime、datetime / datetime2 / timestamp → LocalDateTime、uuid / uniqueidentifier → UUID、bytea / varbinary → byte[]、ENUM → String、text[] → List。字段名下划线转驼峰,已是驼峰的保留原样;与 Java 关键字冲突时加下划线(如 class_),重名时自动编号。E.g. serial → Integer, bigserial / bigint → Long, int unsigned → Long, bigint unsigned → BigInteger, timestamptz / datetimeoffset → OffsetDateTime, datetime / datetime2 / timestamp → LocalDateTime, uuid / uniqueidentifier → UUID, bytea / varbinary → byte[], ENUM → String, text[] → List. snake_case becomes camelCase while existing camelCase is kept; names clashing with Java keywords get an underscore (e.g. class_) and duplicates are numbered.

代码或数据会被上传吗?Is my code or data uploaded?

不会。「SQL 建表语句转 Java 实体类」完全用 JavaScript 在本地运行,适合处理含有密钥、内部接口等敏感内容的数据。No. The SQL (CREATE TABLE) to Java Entity runs entirely in local JavaScript, so it is safe for data containing keys or internal endpoints.

「SQL 建表语句转 Java 实体类」免费吗?需要注册吗?Is the SQL (CREATE TABLE) to Java Entity free? Do I need an account?

「SQL 建表语句转 Java 实体类」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The SQL (CREATE TABLE) to Java Entity is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.

相关工具Related tools

🌲 JSON 可视化树形查看器JSON Tree Viewer🧭 XPath 在线测试XPath Tester🔁 htaccess 转 Nginx 规则htaccess to Nginx Converter⌨️ 键盘测试工具Keyboard Tester🟨 JS 格式化/压缩JavaScript Beautifier & Minifier🛡️ JS 混淆加密JavaScript Obfuscator📦 JS eval 解包JavaScript Unpacker📊 Excel 转 JSONExcel to JSON📈 JSON 转 ExcelJSON to Excel🧾 JSON 格式化校验JSON Formatter & Validator🧪 正则表达式测试Regex Tester⏰ Cron 表达式解析Cron Expression Explainer

← 全部工具All tools