[jira] [Commented] (OLINGO-605) Olingo should support custom types e.g. Geometry by using XmlAdapter from JaxB

2017-10-02 Thread Manuel Blechschmidt (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16188515#comment-16188515
 ] 

Manuel Blechschmidt commented on OLINGO-605:


[~mirbo] thanks a lot.

> Olingo should support custom types e.g. Geometry by using XmlAdapter from JaxB
> --
>
> Key: OLINGO-605
> URL: https://issues.apache.org/jira/browse/OLINGO-605
> Project: Olingo
>  Issue Type: New Feature
>  Components: odata2-jpa
>Affects Versions: V2 2.0.3
>Reporter: Manuel Blechschmidt
>Assignee: Michael Bolz
>Priority: Minor
>  Labels: GIS, custom, spatial, types
> Fix For: V2 2.0.10
>
>
> I am currently developing a software where I save GIS coordinates as part of 
> my entities. I want to send these geometries as a string through OData to a 
> client.
> Technically I do the following:
> OpenGis -> Hibernate Spatial -> JPA -> Olingo -> JavaScript -> OpenLayers
> I already have an XmlAdapter that maps my Geometry to WKT. I want to use this 
> as well for Olingo serialization
> I copied the following file in my workspace and extended the 
> convertToEdmSimpleType function:
> org.apache.olingo.odata2.jpa.processor.core.access.model.JPATypeConvertor
> {code:java}
>  public static EdmSimpleTypeKind
>   ...
> } else if(jpaType.equals(Geometry.class)) {
>   // "OData - JPA Type Converter: Type [class 
> com.vividsolutions.jts.geom.Geometry] not supported"
>   return EdmSimpleTypeKind.String;
> }
> throw 
> ODataJPAModelException.throwException(ODataJPAModelException.TYPE_NOT_SUPPORTED
> .addContent(jpaType.toString()), null);
>   }
> {code}
> This is quick and dirty and it would be nice if there would be a cleaner 
> solution to do so.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (OLINGO-605) Olingo should support custom types e.g. Geometry by using XmlAdapter from JaxB

2017-10-02 Thread Michael Bolz (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16188010#comment-16188010
 ] 

Michael Bolz commented on OLINGO-605:
-

Hi [~manuel_b]

Thanks for the feature (see: https://github.com/apache/olingo-odata2/pull/4).
Based on this I updated the master (with minor changes to your pull request), 
see [commit 
7aac7976|https://git-wip-us.apache.org/repos/asf?p=olingo-odata2.git;a=commit;h=7aac7976b3d576f3f24c8c0f4d75e0c7b1e96f95].

Again Thanks for the contribution.

Kind Regards, Michael


> Olingo should support custom types e.g. Geometry by using XmlAdapter from JaxB
> --
>
> Key: OLINGO-605
> URL: https://issues.apache.org/jira/browse/OLINGO-605
> Project: Olingo
>  Issue Type: New Feature
>  Components: odata2-jpa
>Affects Versions: V2 2.0.3
>Reporter: Manuel Blechschmidt
>Assignee: Michael Bolz
>Priority: Minor
>  Labels: GIS, custom, spatial, types
>
> I am currently developing a software where I save GIS coordinates as part of 
> my entities. I want to send these geometries as a string through OData to a 
> client.
> Technically I do the following:
> OpenGis -> Hibernate Spatial -> JPA -> Olingo -> JavaScript -> OpenLayers
> I already have an XmlAdapter that maps my Geometry to WKT. I want to use this 
> as well for Olingo serialization
> I copied the following file in my workspace and extended the 
> convertToEdmSimpleType function:
> org.apache.olingo.odata2.jpa.processor.core.access.model.JPATypeConvertor
> {code:java}
>  public static EdmSimpleTypeKind
>   ...
> } else if(jpaType.equals(Geometry.class)) {
>   // "OData - JPA Type Converter: Type [class 
> com.vividsolutions.jts.geom.Geometry] not supported"
>   return EdmSimpleTypeKind.String;
> }
> throw 
> ODataJPAModelException.throwException(ODataJPAModelException.TYPE_NOT_SUPPORTED
> .addContent(jpaType.toString()), null);
>   }
> {code}
> This is quick and dirty and it would be nice if there would be a cleaner 
> solution to do so.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (OLINGO-605) Olingo should support custom types e.g. Geometry by using XmlAdapter from JaxB

2017-06-17 Thread Manuel Blechschmidt (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16052874#comment-16052874
 ] 

Manuel Blechschmidt commented on OLINGO-605:


[~mirbo] is it possible to assign this issue to somebody?

> Olingo should support custom types e.g. Geometry by using XmlAdapter from JaxB
> --
>
> Key: OLINGO-605
> URL: https://issues.apache.org/jira/browse/OLINGO-605
> Project: Olingo
>  Issue Type: New Feature
>  Components: odata2-jpa
>Affects Versions: V2 2.0.3
>Reporter: Manuel Blechschmidt
>Priority: Minor
>  Labels: GIS, custom, spatial, types
>
> I am currently developing a software where I save GIS coordinates as part of 
> my entities. I want to send these geometries as a string through OData to a 
> client.
> Technically I do the following:
> OpenGis -> Hibernate Spatial -> JPA -> Olingo -> JavaScript -> OpenLayers
> I already have an XmlAdapter that maps my Geometry to WKT. I want to use this 
> as well for Olingo serialization
> I copied the following file in my workspace and extended the 
> convertToEdmSimpleType function:
> org.apache.olingo.odata2.jpa.processor.core.access.model.JPATypeConvertor
> {code:java}
>  public static EdmSimpleTypeKind
>   ...
> } else if(jpaType.equals(Geometry.class)) {
>   // "OData - JPA Type Converter: Type [class 
> com.vividsolutions.jts.geom.Geometry] not supported"
>   return EdmSimpleTypeKind.String;
> }
> throw 
> ODataJPAModelException.throwException(ODataJPAModelException.TYPE_NOT_SUPPORTED
> .addContent(jpaType.toString()), null);
>   }
> {code}
> This is quick and dirty and it would be nice if there would be a cleaner 
> solution to do so.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (OLINGO-605) Olingo should support custom types e.g. Geometry by using XmlAdapter from JaxB

2015-04-17 Thread Manuel Blechschmidt (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14499250#comment-14499250
 ] 

Manuel Blechschmidt commented on OLINGO-605:


Just hit the following problem:

{code}
06:44:39,015 ERROR [stderr] (default task-9) Caused by: 
org.apache.olingo.odata2.api.edm.EdmSimpleTypeException: The metadata 
constraints '[Nullable=true, MaxLength=255]' do not allow to format the value 
'MULTIPOLYGON (((4458419.63 5343938.24, 4458395.73 5343927.45, 4458391.04 
5343926.99, 42343450.1 5343907.92, 4458301.19 5343887.61, 4458297 5343894.81, 
4458305.49 5343912.5, 4458313.13 5343928.43, 4458322.14 5343947.21, 4458328.43 
5343972.9, 4458332.47 5343989.38, 4458369.33 5343993.28, 4458437.89 2342314.53, 
4458553.12 42354313.86, 4458555.73 5344011.83, 4458498.07 5343979.64, 
4458458.23 5343958.08, 4458425.61 5343942.69, 4458419.63 5343938.24)))'.
06:44:39,016 ERROR [stderr] (default task-9) at 
org.apache.olingo.odata2.core.edm.EdmString.internalValueToString(EdmString.java:80)
06:44:39,016 ERROR [stderr] (default task-9) at 
org.apache.olingo.odata2.core.edm.AbstractSimpleType.valueToString(AbstractSimpleType.java:112)
06:44:39,016 ERROR [stderr] (default task-9) at 
org.apache.olingo.odata2.core.ep.producer.XmlPropertyEntityProducer.appendProperty(XmlPropertyEntityProducer.java:201)
06:44:39,016 ERROR [stderr] (default task-9) at 
org.apache.olingo.odata2.core.ep.producer.XmlPropertyEntityProducer.append(XmlPropertyEntityProducer.java:67)
06:44:39,016 ERROR [stderr] (default task-9) ... 59 more
{code}

So I had to specify a length attribute on the column.

> Olingo should support custom types e.g. Geometry by using XmlAdapter from JaxB
> --
>
> Key: OLINGO-605
> URL: https://issues.apache.org/jira/browse/OLINGO-605
> Project: Olingo
>  Issue Type: New Feature
>  Components: odata2-jpa
>Affects Versions: V2 2.0.3
>Reporter: Manuel Blechschmidt
>Priority: Minor
>  Labels: GIS, custom, spatial, types
>
> I am currently developing a software where I save GIS coordinates as part of 
> my entities. I want to send these geometries as a string through OData to a 
> client.
> Technically I do the following:
> OpenGis -> Hibernate Spatial -> JPA -> Olingo -> JavaScript
> I already have an XmlAdapter that maps my Geometry to WKT. I want to use this 
> as well for Olingo serialization
> I copied the following file in my workspace and extended the 
> convertToEdmSimpleType function:
> org.apache.olingo.odata2.jpa.processor.core.access.model.JPATypeConvertor
> {code:java}
>  public static EdmSimpleTypeKind
>   ...
> } else if(jpaType.equals(Geometry.class)) {
>   // "OData - JPA Type Converter: Type [class 
> com.vividsolutions.jts.geom.Geometry] not supported"
>   return EdmSimpleTypeKind.String;
> }
> throw 
> ODataJPAModelException.throwException(ODataJPAModelException.TYPE_NOT_SUPPORTED
> .addContent(jpaType.toString()), null);
>   }
> {code}
> This is quick and dirty and it would be nice if there would be a cleaner 
> solution to do so.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OLINGO-605) Olingo should support custom types e.g. Geometry by using XmlAdapter from JaxB

2015-04-15 Thread Manuel Blechschmidt (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14496209#comment-14496209
 ] 

Manuel Blechschmidt commented on OLINGO-605:


Pull request can be found here:

https://github.com/apache/olingo-odata2/pull/4


> Olingo should support custom types e.g. Geometry by using XmlAdapter from JaxB
> --
>
> Key: OLINGO-605
> URL: https://issues.apache.org/jira/browse/OLINGO-605
> Project: Olingo
>  Issue Type: New Feature
>  Components: odata2-jpa
>Affects Versions: V2 2.0.3
>Reporter: Manuel Blechschmidt
>Priority: Minor
>  Labels: GIS, custom, spatial, types
>
> I am currently developing a software where I save GIS coordinates as part of 
> my entities. I want to send these geometries as a string through OData to a 
> client.
> Technically I do the following:
> OpenGis -> Hibernate Spatial -> JPA -> Olingo -> JavaScript
> I already have an XmlAdapter that maps my Geometry to WKT. I want to use this 
> as well for Olingo serialization
> I copied the following file in my workspace and extended the 
> convertToEdmSimpleType function:
> org.apache.olingo.odata2.jpa.processor.core.access.model.JPATypeConvertor
> {code:java}
>  public static EdmSimpleTypeKind
>   ...
> } else if(jpaType.equals(Geometry.class)) {
>   // "OData - JPA Type Converter: Type [class 
> com.vividsolutions.jts.geom.Geometry] not supported"
>   return EdmSimpleTypeKind.String;
> }
> throw 
> ODataJPAModelException.throwException(ODataJPAModelException.TYPE_NOT_SUPPORTED
> .addContent(jpaType.toString()), null);
>   }
> {code}
> This is quick and dirty and it would be nice if there would be a cleaner 
> solution to do so.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)