Giter Site home page Giter Site logo

odata-boilerplate's People

Contributors

jpenninkhof avatar mkysoft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

odata-boilerplate's Issues

It returns DateTime or Timestamp values in a wrong format

The problem is olingo does not return the date/time or timestamp columns in a correct format as defined in Odata standard (or maybe Microsoft standard). I mean my front-end library (i.e. OpenUI5) expects some value like <d:ValidFrom>/Date(1579075200000)/</d:ValidFrom> for Edm.DateTime column but what olingo returns is <d:ValidFrom>2020-01-15T08:00:00</d:ValidFrom> which is not accepted by OpenUI5!

What is your suggestion?

1- Is there a way that I force Olingo to return data/time or timestamp in the format that Microsoft defined or not? (i.e. /Date(timestamp)/)

2- Is there a way that OpenUI5 accept the date\time in a format like yyyy-MM-ddTHH:mm:ss ?

JPA problem with primary key of type string

When I make a table with primary key of type string then I can only read all the items inside the set, or create a new item. But I cannot read a single item with its id, or delete or update it!

https://stackoverflow.com/questions/62081165/jpa-has-problem-with-tables-entities-with-primary-key-of-type-string

It seems the code has a problem. I cannot even filter string columns. For example for the following url I see this error on the original code:

http://localhost:9090/odata.svc/Members?$format=json&$filter=FirstName eq 'Jack'

{
    "error": {
        "code": null,
        "message": {
            "lang": "en",
            "value": "org.hibernate.exception.SQLGrammarException: could not extract ResultSet"
        }
    }
}

Getting 404 error when deployed as war on tomcat.

I am deploying war file using -

mvn clean package -P hcp
sudo cp target/odata.war /opt/tomcat/webapps
sudo $CATALINA/bin/catalina.sh start

I have also tried setting server.contextPath=/myodata in application.properties.

How to implement i18n for JPA entities?

My question is how can I add internationalization functionality to a specific column without any foreign keys and by using JSON structure?

For example I would like to define a JPA entity like this:

@Entity
class Book {

    @Id
    private int id;

    private Author author;

    @I18n  //<- this annotation is something that I am looking for 
    private String title;

}

and then the data in title column would be stored like the following for en and de locales:

{"en":"Cologne","de":"Köln"}

And then when the current locale is de the Köln and when the en is set as locale then Cologne fetch in the time of reading data!

Also when we store the data, the passed string is stored in the relevant property in the JSON format. For example if the locale is set to es and user passes Kolne then we have to have the following data in the DB:

{"en":"Cologne","de":"Köln","es":"Kolne"}

It is interesting for me that most of the solutions in the web for hibernate and JPA is based on an old method that we have languages and translations tables. Something like here or here.

However what I am looking for is some solutions like this one which is suggested for Laravel and store the translations exactly in the way that I explained (i.e. in a JSON object and in the same column)!

The only solution that I found and could be somehow relevant (Not 100%) is this one, however it does not working when I tried to test it and it seems does not supported anymore!

Enable function imports

I've seen that it's unable to create function Imports. There is any way to implement that? I just think to modify jpa-processor jar library but not sure how.

odata-mapping.xml is missing

I need to set the Entity Set names like "EntitySet" instead of "Entities"!

I found the following tutorial.

And in the JPAEdmExtension.java file you have a line like this:

public static final String MAPPING_MODEL = "odata-mapping.xml";

@Override
	public InputStream getJPAEdmMappingModelStream() {
		return JPAEdmExtension.class.getClassLoader().getResourceAsStream(MAPPING_MODEL);
	}

However this file is missing in the repository and I have made a file according to the tutorial that I mentioned and I have put it in the WEB-INF, but it does not change the set name as expected.

<JPAEDMMappingModel
	xmlns="http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping">
	<PersistenceUnit name="Model">
		<EDMSchemaNamespace>me.cimply</EDMSchemaNamespace>
		<JPAEntityTypes>
			<JPAEntityType name="Member">
				<EDMEntityType>Member</EDMEntityType>
				<EDMEntitySet>MemberSet</EDMEntitySet>
			</JPAEntityType>
		</JPAEntityTypes>
	</PersistenceUnit>
</JPAEDMMappingModel>

What is the problem, how can I modify the entity set name?

Json Response

Can you please tell me what is the fix to get the json response back , as i am seeing xml response for now and when i pass header with the content type json and it says it is not allowed. Please recommend the solution to get the json response back.

Support $batch operations

In the SevletRegister you need to configure multipart to support batch operations.

Just include this line

odataServletRegistrationBean.setMultipartConfig(new MultipartConfigElement(""));

Thanks for your example, it was very helpful.

How to build for Tomcat?

When I try mvn clean install it build the odata-0.1.0.war file, but when I deploy it in tomcat I cannot run it. It will show this error: FAIL - Application at context path [/odata-0.1.0] could not be started

How ever I can run the project inside the Eclipse with MySql !

When I try to run it with tomcat server inside the eclipse it shows this error:

SEVERE: Error during ServletContainerInitializer processing
javax.servlet.ServletException: Failed to instantiate WebApplicationInitializer class
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:160)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5140)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:633)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:343)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:474)
Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at com.penninkhof.odata.Application.(Application.java:18)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:157)
... 29 more
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1365)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188)
... 36 more

Any solution for building and running in Tomcat 9?

Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean

I have some exceptions when i import this project. The exceptions is as follows:
_SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
at com.penninkhof.odata.Application.main(Application.java:28)
Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getEmbeddedServletContainerFactory(EmbeddedWebApplicationContext.java:185)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:158)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:130)
... 8 more_
Best Regards!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.