带有映射的 Java 数据库?
我将创建一个需要使用映射的数据库,(这不是 JAVA EE)我说的只是 JavaSE 而不是 EE,我想知道我将如何实现我创建的这些类? (User,Contactinformation,Employee,FinanceTeam,SystemAdmin) 我如何将这些对象的数据传输到数据库中? 映射是如何工作的? BASIC 数据库教程将对我有很大帮助,谢谢顺便说一句,如果你好奇我正在使用 MySQL 作为我的数据库
I am going to make a database where I need to make use of mapping, (THIS IS NOT JAVA EE) I am speaking of JavaSE only not EE, I was wondering how would I implement these class I made? (User,Contactinformation,Employee,FinanceTeam,SystemAdmin) how will I transfer the datas of these objects into the database? and how does mapping work? a BASIC Database tutorial will HELP me a lot, Thanks Btw if you are curious I am using MySQL for my database
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
评论(2)
你需要一个ORM(Object-Relational Mapping),而Hibernate是最常用的,Hibernate也可以独立使用,不仅在Java EE环境中。
官方教程
JavaBrains Hibernate Tutorial
JavaBrains 视频教程共 34 节课,解释清楚且易于理解,我强烈推荐您。 作者不是以英语为母语的人,所以如果你不看口音,这是一个很棒的内容。
You need an ORM (Object-Relational Mapping) and Hibernate is the most commonly used, Hibernate can also be used standalone, not only in Java EE environment.
The official tutorial
JavaBrains Hibernate Tutorial
JavaBrains video tutorial is 34 lessons, well explained and easy to understand, I highly recommend you. The author is not a native English speaker, so if you look past the accent, it's a great content.
为什么不使用像 Hibernate 或 EclipseLink 这样的 JPA? 它们在 J2SE 环境中工作得很好,唯一的区别是您获取 EntityManager 引用的方式。 (通过直接创建 EntityManagerFactory 而不是容器管理注入)
Why not use a JPA like Hibernate or EclipseLink? They work just fine in a J2SE environment, the only difference is how you obtain the EntityManager reference. (By creating the EntityManagerFactory directly as opposed to Container Managed Injection)