- Developing Middleware in Java EE 8
- Abdalla Mahmoud
- 117字
- 2021-07-23 19:24:37
Table mapping
By default, an entity class is mapped to a table with the same name as the class. However, there are cases when you need to modify this default name for one of the following reasons:
- You need to use a custom name for a neater database design.
- You have to map it to an existing table in a legacy database.
- Your entity name is a SQL reserved keyword, for example, User. You are forced to modify the table name, otherwise you will end up with a runtime error.
The @Table annotation is used to customize the table name as in the following example:
@Entity @Table(name = "movies") public class Movie { ... }
推薦閱讀
- Java程序設計與開發
- Visual FoxPro程序設計教程
- PHP程序設計(慕課版)
- JIRA 7 Administration Cookbook(Second Edition)
- Ext JS Data-driven Application Design
- Python Geospatial Development(Second Edition)
- Interactive Applications Using Matplotlib
- SAP BusinessObjects Dashboards 4.1 Cookbook
- Spring Boot進階:原理、實戰與面試題分析
- Node.js:來一打 C++ 擴展
- ExtJS Web應用程序開發指南第2版
- Instant Zurb Foundation 4
- C語言程序設計教程
- Building Clouds with Windows Azure Pack
- 你好!Python