[
https://jira.jboss.org/jira/browse/DNA-293?page=com.atlassian.jira.plugin...
]
Randall Hauch commented on DNA-293:
-----------------------------------
Actually, I just found this in Section 8.5.2.9 of the JSR-170 spec (which is Section
7.5.2.9 of the draft JSR-283 spec), which is about how to deal with property values in SQL
queries when the property definition's type is "undefined":
"When a node type T defines a property P with an UNDEFINED property type this
means that two
node instances of type T can each have a property called P but with differing property
types.
In such cases the database view of T is a single column of type VARCHAR (see below).
In other
words, the different types are converted to strings."
I'm not sure whether this is a better strategy for choosing the actual property type
for a Property instance. It is likely that the SQL query functionality needs to use the
PropertyDefinition objects (without the luxury of actual Property instances) to plan
queries.
JcrSession creates Property instances that use the
PropertyType.UNDEFINED, which is not allowed
-----------------------------------------------------------------------------------------------
Key: DNA-293
URL:
https://jira.jboss.org/jira/browse/DNA-293
Project: DNA
Issue Type: Bug
Components: JCR
Affects Versions: 0.3
Reporter: Randall Hauch
Assignee: Randall Hauch
Fix For: 0.4
The "undefined" property type is only allowed in property definitions.
According to the JSR-170 specification (Section, 6.2.5):
"This constant can be used within a property definition (see 6.7.6 Property
Definitions) to specify that the property in
question may be of any type. However, it cannot be the actual type of any property
instance. For example it will
never be returned by Property.getType and (in level 2 implementations) it cannot be
assigned as the type when
creating a new property."
When the property definition has a type of "undefined", then we'll need to
choose what actual type to use. There doesn't appear to be any guidance on this in
the spec (anybody?), so barring that the most logical approach is probably to look at the
first property value.
Note that this is one reason why the DNA graph API was designed with the value factories
to allow (or encourage) the client to convert the property values to the type desired by
the client. Because of this, it doesn't matter so much what type the value actually
is, but rather that it can be converted to the type needed by the user. So this should
make the above assumption (about choosing the property type based upon value) a pretty
decent one.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira