Could not find a setter for property normalRange in class org.openehr.rm.datatypes.quantity.DvOrdinal

Hibernate complains in derived classes because there are no setters for
normalRange and referenceRanges in class DvOrdered.

What shall I do about this, is this going to change or do I
misunderstand something?

Bert

Hi Bert,

The getters are there. The setters should be added.

Regards,
Rong

Bert Verhees wrote:

Rong Chen schreef:

Hi Bert,

The getters are there. The setters should be added.

Regards,
Rong

Thanks, I can add them and see them appear in the repository later

Bert

Rong Chen schreef:

Hi Bert,

The getters are there. The setters should be added.
  

Maybe limitIndex in DvOrdinal is obsoleet, it is not in the documentation.
Bert

Rong Chen schreef:

Hi Bert,

The getters are there. The setters should be added.
  

setter for property range in class
org.openehr.rm.datatypes.quantity.ReferenceRange is also missing, I add
it too. \
Bert

Bert Verhees wrote:

Rong Chen schreef:

Hi Bert,

The getters are there. The setters should be added.

Regards,
Rong
  

Thanks, I can add them and see them appear in the repository later

They have been fixed on the trunk already! :slight_smile:
R

Rong Chen schreef:

Bert Verhees wrote:
  

Rong Chen schreef:
    

Hi Bert,

The getters are there. The setters should be added.

Regards,
Rong
  

Thanks, I can add them and see them appear in the repository later
    

They have been fixed on the trunk already! :slight_smile:
  

sorry to tell, also setter for meaning in referencerange missing
now, you are busy :wink:
B

Rong, I think the class DvQuantified also needs a work-out.

Following the documentation there should be setters/getters for
properties accuracy, accuracy(Is)Percent
Also Magnitude_status should be added, I believe

regards,
Bert

Rong Chen schreef:

Rong,

I just write them down as I find them, after compare with the
documentation, please don't feel urged, I repair them in my own source.
Maybe I find some more, please note if I am wrong. Maybe hibernate 3.0.3
is less permissive then hibernate 2.x was.

Got exception: Could not find a getter for value in class
org.openehr.rm.datatypes.quantity.datetime.DvDuration

regards
Bert

Bert Verhees schreef:

also setter for value needed in DvTimeSpecification

regards
Bert

getter for value in DvWorldDateTime

:wink:

Bert

Following the documentation:
I think, ImportedVersion, the property "original" should be replaced by
"item" and appropriate getter/setters added

:slight_smile:

Bert

void setIsControlled(boolean isControlled) {
    this.isControlled = isControlled;
  }
  
  public boolean getIsControlled(){
    return this.isControlled;
  }

in AuthoredResource

Bert

Hi Rong, and others, I want to ask you to consider following (at the end
of the email is a question). This is Hibernate3-related

- ------------------------------------
What is the purpose of making a Java-class "final"?

In my opinion, but I maybe am wrong on this:
It is a formal statement, preventing sub classing, a formal restriction,
for good reasons.
I don't think there are any advantages in terms of execution-behavior,
but this is where I am maybe wrong.
- ------------------------------------
Why am I bringing this under attention.

I get following exceptions (more/many of them):

WARN [main] (PojoTuplizer.java:156) - could not create proxy factory
for:org.openehr.rm.datastructure.itemstructure.ItemList
org.hibernate.HibernateException: CGLIB Enhancement failed:
org.openehr.rm.datastructure.itemstructure.ItemList
.........
.........
.........
Caused by: java.lang.IllegalArgumentException: Cannot subclass final
class class org.openehr.rm.datastructure.itemstructure.ItemList
        at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:438)
        at net.sf.cglib.core.DefaultGeneratorStrategy.generate(Default

etc..etc..
- ------------------------------------
This brought me to the Hibernate-faq, where I read this (another, but
same caused problem, I think):

I get org.hibernate.HibernateException: CGLIB Enhancement failed:
<classname>?
If you use lazy loading with proxies (default for all classes in
Hibernate 3), Hibernate needs to subclass your class at runtime. It
can't do this if you have a private no-argument constructor. As per
documentation, at least package visibility is required.

(see: http://www.hibernate.org/116.html#A5)
- ------------------------------------
Just put lazy load off, it is possible, why not, well I bought a 900
pages PDF about Hibernate3 (I can really recommend it. "Java Persistence
and Hibernate"), in that document I read following, from which one can
conclude that putting lazy-load off is mostly not wise to do.
It says:
"Hibernate defaults to a lazy fetching strategy for all entities and
collections. This means that Hibernate by default loads only the objects
you?re querying for. Let?s explore this with a few examples......"
- ------------------------------------
Maybe I am misunderstanding something, please explain, else, please
consider following:
Is the directive "final" that important that we want to let Hibernate
run in a suboptimal mode? Or do we change final-classes in the
repository to normal classes, and urge people not to subclass them?

Or, (here is a lack of some parts in my knowledge of Java), is it
possible to use compiler switches, directives, precompiler statements
(like in C or Delphi), to maintain both code-paths in the code?

Thanks in advance for your considerations

kind regards, and have a nice weekend
Bert

There is another problem connected to lazy-load.

There must be a default constructor in every class with
package-visibility, I think this means public?

It is to avoi this exception:
ERROR [main] (CGLIBLazyInitializer.java:103) - CGLIB Enhancement failed:
org.openehr.rm.datatypes.quantity.DvOrdinal
java.lang.IllegalArgumentException: Superclass has no null constructors
but no arguments were given
  at net.sf.cglib.proxy.Enhancer.emitConstructors(Enhancer.java:783)
  at net.sf.cglib.proxy.Enhancer.emit(Enhancer.j..... etc

I found this information, at
http://www.jroller.com/page/robwilliams/20060413

and I tested it, it works. I changed the DvInterval default constructor
from private to public, and the exception in that class disappeared.

As the same as with my previous email (here below) I suggest to add the
changed classes to the repository, because, otherwise, Hibernate3 cannot
use lazy-mode, which makes it unusable, I am afraid.

I am changing it in my private cpy of the code, and hope to see the
changes appear in the repository

Thanks
Bert

Bert Verhees schreef:

Bert Verhees schreef:

There is another problem connected to lazy-load.

There must be a default constructor in every class with
package-visibility, I think this means public?

It is to avoi this exception:
ERROR [main] (CGLIBLazyInitializer.java:103) - CGLIB Enhancement failed:
org.openehr.rm.datatypes.quantity.DvOrdinal
java.lang.IllegalArgumentException: Superclass has no null constructors
but no arguments were given
  at net.sf.cglib.proxy.Enhancer.emitConstructors(Enhancer.java:783)
  at net.sf.cglib.proxy.Enhancer.emit(Enhancer.j..... etc

I found this information, at
http://www.jroller.com/page/robwilliams/20060413

and I tested it, it works. I changed the DvInterval default constructor
from private to public, and the exception in that class disappeared.

As the same as with my previous email (here below) I suggest to add the
changed classes to the repository, because, otherwise, Hibernate3 cannot
use lazy-mode, which makes it unusable, I am afraid.

I am changing it in my private cpy of the code, and hope to see the
changes appear in the repository

I mean, I have no rights to add code to the repository, Rong, I hope you
make the changes.

Sorry for providing you in tasks extra

Maybe you do not agree with my point of view, I hope, I learn your
about your motivations, soon, because I am very busy with this and maybe
need to think about your opinions

Thanks
Bert