- 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 { ... }
推薦閱讀
- C#程序設計實訓指導書
- JavaScript語言精髓與編程實踐(第3版)
- Python測試開發入門與實踐
- Mastering C# Concurrency
- 你必須知道的204個Visual C++開發問題
- 領域驅動設計:軟件核心復雜性應對之道(修訂版)
- 新一代SDN:VMware NSX 網絡原理與實踐
- Java SE實踐教程
- Scratch·愛編程的藝術家
- Zabbix Performance Tuning
- Mastering Concurrency in Python
- C語言程序設計實踐
- Laravel Design Patterns and Best Practices
- IBM RUP參考與認證指南
- Office VBA開發經典:中級進階卷