简体   繁体   English

Grails Hibernate 注释

[英]Grails Hibernate annotations

Can any1 explain me what hibernate annotations are for?谁能解释一下 hibernate 注释的用途是什么? I'm learning hibernate/grails and can't understand what it does.我正在学习hibernate/grails,但无法理解它的作用。 Check here: http://grails.org/doc/1.0.x/guide/15.%20Grails%20and%20Hibernate.html .在这里查看: http://grails.org/doc/1.0.x/guide/15.%20Grails%20and%20Hibernate.html

Hibernate annotations are an alternative way to map your domain classes to the database. Hibernate 注释是 map 您的域类到数据库的替代方法。 Generally, they should only be used if you have an existing Hibernate-annotated domain model that you want to use in a Grails app.通常,只有在您想要在 Grails 应用程序中使用的现有 Hibernate 注释域 model 时才应使用它们。

If you don't already have an existing domain model, then using the default GORM conventions is a more convenient way to map your domain classes to the database.如果您还没有现有的域 model,那么使用默认的 GORM 约定是将您的域类 map 到数据库的更方便的方法。

Hibernate annotations are used to configure object-relational mapping of your objects, ie they define how your objects are persisted into the database. Hibernate 注释用于配置对象的对象关系映射,即它们定义对象如何持久保存到数据库中。 You can find more info on using them in the Hibernate documentation .您可以在Hibernate 文档中找到有关使用它们的更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM