EUDEMON ODATA
What is eudemon odata ?
eudemon odata is an API development framework for building standardized, OData V4 based RESTful services on java ecosystem.
What is OData?
OData stands for the Open Data Protocol. It was initiated by Microsoft and is now an ISO ratified OASIS standard. OData enables the creation and consumption of REST APIs, which allow resources, identified using URLs and defined in a data model, to be published and edited by Web clients using simple HTTP requests.
For more information about OData, please refer to the following resources:
For how to adopt this and related libraries to build OData server, please refer to the Getting Started
Requirements
- Spring data
- Query dsl plugin
- Installed JDK 8 or higher
- database driver
Getting Started
Add eudemon odata starter to your Maven project:
<dependency>
<groupId>fr.cloverconsulting</groupId>
<artifactId>eudemon-odata-starter</artifactId>
<version>${eudemon.version}</version>
</dependency>
add now querydsl dependencies (for more details see querydsl github)
create a spring boot project for more help you can use spring initialzer or start from our sample projects ##sample code
sample entity
@Entity(name="user")
@Table(name = "user")
@Getter
@Setter
public class User implements Serializable {
@Id
@Column(name = "myid")
Integer myid;
@Column(name = "firstname")
String firstname;
@Column(name = "lastname")
String lastname ;
@OneToMany(mappedBy = "user",cascade = CascadeType.ALL)
Set<Adress> adress;
@Embedded
Job fonction;
}
spring data repository
add your repository interface and extends OdataExecutor User repositry interface
public interface UserRepository extends JpaRepository<User,String> , OdataExecutor<User> {
}
configuration
Add the following parameters into application.yml file
odata:
namespace: cloverconsulting
path: "myendpoint/v1"
Start your server.
Enjoy :)
Support
- Issues: Report issues on Github issues.
- Questions: Ask questions on Stack Overflow.
- Feedback: Please send mails to [email protected].