[英]Constructor in persistance class
I am using HIbernate version 3.2.5. 我使用的是HIbernate版本3.2.5。
I read the below line in hibernate tutorials: 我在hibernate教程中阅读了以下内容:
The no-argument constructor is a requirement for all persistent classes.Hibernate has to create objects for you, using Java Reflection. The constructor can be private
This is the link for the tutorial: 这是教程的链接:
http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/tutorial.html http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/tutorial.html
But when I write a persistence class without a no-arg constructor, then also it works fine (I tried only retrieval part). 但是当我编写一个没有no-arg构造函数的持久化类时,它也可以正常工作(我只尝试检索部分)。
Hence where lies the validity of the above statement? 那么上述陈述的有效性在哪里呢?
Please let me know if I am getting something worng. 如果我有问题,请告诉我。
Regards, 问候,
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.