Skip to content

Commit 7246c71

Browse files
Mapping enum via AttributeConverter
1 parent 1da12da commit 7246c71

File tree

1 file changed

+1
-1
lines changed
  • HibernateSpringBootEnumAttributeConverter

1 file changed

+1
-1
lines changed

HibernateSpringBootEnumAttributeConverter/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
**[How To Map Java `enum` To Database Via `AttributeConverter`](https://github.com/AnghelLeonard/Hibernate-SpringBoot/tree/master/HibernateSpringBootEnumAttributeConverter)**
22

3-
**Description:** This application maps a Java `enum` via `AttributeConverter`. In other words, it maps the `enum` values `HORROR`, `ANTHOLOGY` and `HISTORY` to the integers `1`, `2` and `3` and viceversa. This allows us to set the column type as `SMALLINT` which is less space-consuming then `VARCHAR`.
3+
**Description:** This application maps a Java `enum` via `AttributeConverter`. In other words, it maps the `enum` values `HORROR`, `ANTHOLOGY` and `HISTORY` to the integers `1`, `2` and `3` and viceversa. This allows us to set the column type as `SMALLINT` which is less space-consuming than `VARCHAR(9)` needed in this case.
44

55
**Key points:**\
66
- define a custom `AttributeConverter`\

0 commit comments

Comments
 (0)