Skip to content

wizzdi/flexicore-boot-starter-data-jpa-hibernate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlexiCore Boot Starter Data JPA Build StatusMaven Central

For comprehensive information about FlexiCore Boot Starter Data JPA please visit our site.

What it does?

FlexiCore Boot Starter Data JPA is a FlexiCore Module that provides an opinionated Eclipselink JPA registration for spring boot.

How to use?

Add the flexicore-boot-starter-data-jpa-hibernate dependency using the latest version available from maven central:

        <dependency>
            <groupId>com.wizzdi</groupId>
            <artifactId>flexicore-boot-starter-data-jpa-hibernate</artifactId>
            <version>LATEST</version>
        </dependency>

annotate your application class or your configuration class with

@EnableFlexiCoreJPAPlugins

you have have to use Spring's PropertiesLauncher to load your application with entities plugins , here is an example for the command line:

java -Dloader.main=com.your.company.YourApplicationClass -Dloader.path=file:/path/to/entities/folder -jar your-application-exec.jar 

Example

your application class:

@EnableFlexiCorePlugins  
@EnableFlexiCoreJPAPlugins
@SpringBootApplication  
public class App {  
  
   public static void main(String[] args) {  
  
      SpringApplication app = new SpringApplication(App.class);  
  app.addListeners(new ApplicationPidFileWriter());  
  ConfigurableApplicationContext context=app.run(args);  
  
  }
}

an entity inside an entity plugin:

@Entity  
public class TestEntity {  
  
   @Id  
  private String id;  
  
 private String name;  
  
  @Id  
  public String getId() {  
      return id;  
  }  
  
   public <T extends TestEntity> T setId(String id) {  
      this.id = id;  
 return (T) this;  
  }  
  
   public String getName() {  
      return name;  
  }  
  
   public <T extends TestEntity> T setName(String name) {  
      this.name = name;  
 return (T) this;  
  }  
}

Configuration

FlexiCore Boot Starter Data JPA exposes the following configuration options:

name default value description
flexicore.entities /home/flexicore/entities/ location of entities plugins should be the same as the one provided for Dloader.path in the command running the application

Main Dependencies

FlexiCore Boot

Eclipselink

Spring Boot Starter Data JPA

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published