> >
> > so? you also cannot store a book where SQL expects an int.
> >
>
> Now I'm confused.
>
> What _good_ RDBMS API have you used that allows you to pass types that
aren't
> natively supported by the DB in update operations?

> Just to recap I'll rewrite
> the query that Kimbro agreed didn't make sense that you are now advocating
> should be a valid part of the API
>
>  String xpath = "count(/movie/title='Gladiator')";
>
>   XPathQueryService service =
>      (XPathQueryService) collection.getService("XPathQueryService",
"1.0");
>
>    ResourceSet resultSet = service.query(xpath);
>
> ResourceIterator results = resultSet.getIterator();
>
> while (results.hasMoreResources()) {
>    XPathResultResource resource =
>       (XPathResultResource) results.nextResource();
>
>  myCollection.addResource(resource);   /* THIS MAKES NO SENSE */
> }
>

Err, so "addResource" on a BinaryResource is OK _from an interface point of
view_ when "addResource" on an integer doesn't make sense? Do you really
mean this?

A collection/list/set of integers is a _perfectly_ reasonable and well
understood entity.

Either "myCollection" understands lists of integers or it doesn't. If it
understands lists of integers, then it is perfectly happy. If it doesn't
then the collection should complain that the the resource is not of the
proper _type_ to add to the collection. If you do not wish to allow the
elements of "myCollection" to be integers then you can _simply_ throw an
exception when you try to add the resource.

What makes this different then a collection that expects a list of XML
documents each of which is valid to a particular schema, or a parent XML
element into which you attempt to insert a child element that would make the
XML invalid?

Jonathan

----------------------------------------------------------------------
Post a message:         mailto:[EMAIL PROTECTED]
Unsubscribe:            mailto:[EMAIL PROTECTED]
Contact administrator:  mailto:[EMAIL PROTECTED]
Read archived messages: http://archive.xmldb.org/
----------------------------------------------------------------------

Reply via email to