[xwiki-users] number property object?
hello XWiki experts, I have an object property that's of type number. I have not been able to find the type of a variable x so that: doc.getObject("Space.Class").set("amountr", x) doc.save() works without a hibernate error. I tried float or integer "sub-type" of number. What should I put? I tried with x=new Float(1.0f) but failed. thanks for hints. paul
Hi Paul, On Thu, Oct 13, 2011 at 7:18 PM, Paul Libbrecht <[email protected]> wrote:
hello XWiki experts,
I have an object property that's of type number.
I have not been able to find the type of a variable x so that:
doc.getObject("Space.Class").set("amountr", x) doc.save()
works without a hibernate error. I tried float or integer "sub-type" of number.
What should I put?
The Number class property type has a meta property called "Number type" which is set to one of {integer, long, float, double}. Maybe you should check its value. Hope this helps, Marius
I tried with x=new Float(1.0f) but failed.
thanks for hints.
paul _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
On 10/13/2011 12:18 PM, Paul Libbrecht wrote:
hello XWiki experts,
I have an object property that's of type number.
I have not been able to find the type of a variable x so that:
doc.getObject("Space.Class").set("amountr", x) doc.save()
works without a hibernate error.
What is the error you get?
I tried float or integer "sub-type" of number.
What should I put? I tried with x=new Float(1.0f) but failed.
thanks for hints.
-- Sergiu Dumitriu http://purl.org/net/sergiu/
Le 14 oct. 2011 à 19:44, Sergiu Dumitriu a écrit :
I have an object property that's of type number. I have not been able to find the type of a variable x so that: doc.getObject("Space.Class").set("amountr", x) doc.save() works without a hibernate error.
What is the error you get?
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.xpn.xwiki.objects.FloatProperty#<?xml version="1.0" encoding="UTF-8"?> <amount>75</amount> ] at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1765) at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2407) at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2307) Ambiguity killed me: I thought it was the data-mapping that was wrong. The document's object storage was viced which I noticed trying to delete objects. Using another document name suddenly prevented them. Pretty evil an error. As usual, I'm using an old version of XWiki (still 1.5.4). Is this error still current? Would there be a way to differentiate the two situations? paul
participants (3)
-
Marius Dumitru Florea -
Paul Libbrecht -
Sergiu Dumitriu