Distributed SQL Tips: Java to PostgreSQL Enums Conversion

Опубликовано: 09 Октябрь 2024
на канале: Yugabyte
611
19

With enums, we can enforce data integrity in a human-readable format. As a result, it’s unsurprising that this data type is natively supported in Java, PostgreSQL, and YugabyteDB. However, the conversion between Java and PostgreSQL enums doesn’t work out of the box.

The video shows a generic way of handling the Java and PostgreSQL enums conversion. The approach works for plain JDBC APIs and popular ORM frameworks such as Spring Data, Hibernate, Quarkus, and Micronaut.

Curious to learn more? Check out the following article:
https://dzone.com/articles/the-generi...

DISCOVER MORE IN OUR DISTRIBUTED SQL TIPS FOR JAVA SERIES:
   • Distributed SQL Tips for Java  

Video chapters:
0:00 Introduction
0:41 Test Overview
1:39 Testing enums on the database end
2:38 Passing Java enum as a String to YugabyteDB
5:00 Creating the cast operator
5:40 Repeating the test
6:37 Summary

About Yugabyte: YugabyteDB is an open source, high-performance distributed SQL database built for your mission-critical applications. It is PostgreSQL compatible, cloud native, and runs on any public or hybrid cloud.

Learn more: https://www.yugabyte.com/
Learn more about distributed SQL at https://www.yugabyte.com/tech/distrib...

RESOURCES:
-YugabyteDB / Start Now: https://cloud.yugabyte.com
-Site: https://www.yugabyte.com
-GitHub: https://github.com/yugabyte

COMMUNITY:
-Slack: https://communityinviter.com/apps/yug...
-YouTube:    / yugabyte  
-Instagram:   / yugabytedb  
-Twitter:   / yugabyte  
-LinkedIn:   / yugabyte  

You can connect to all our community channels here: https://linktr.ee/yugabyte