Или вообще не нужно класть файл database.db при билде jar файла?
public class Car {
private String carNumber, carModel, carOwner;
private Date lastRepairDate, repairedDate;
// Constructors
public Car() {}
public Car(String carNumber, String carModel, String carOwner, Date lastRepairDate, Date repairedDate) {
this.carNumber = carNumber;
this.carModel = carModel;
this.carOwner = carOwner;
this.lastRepairDate = lastRepairDate;
this.repairedDate = repairedDate;
}
// Getters & Setters
// toString()
}
Очень хотелось бы дочерние записи (DictionaryContent ) связать с Dictionary по средствам его UUID идентификатора.
@Entity
public class Dictionary {
@OneToMany(mappedBy = "dictionary")
private List<DictionaryContent> contentList;
}
@Entity
public class DictionaryContent {
@ManyToOne
@JoinColumn(name = "id")
private Dictionary dictionary;
}
однако в таблице DictionaryContent, не появляется никакого идентификатора-указателя на родительский Dictionary.
localhost:8080/${contextPath}
resolver.setPrefix("resources/templates/");
resolver.setSuffix(".html");
@Configuration
@EnableWebMvc
@Profile("production")
public class WebMvcConfig implements WebMvcConfigurer {
@Bean
public ITemplateResolver templateResolver() {
SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver();
resolver.setPrefix("resources/templates/");
resolver.setSuffix(".html");
resolver.setTemplateMode(TemplateMode.HTML);
resolver.setCacheable(false);
return resolver;
}
@Bean
public SpringTemplateEngine templateEngine() {
SpringTemplateEngine templateEngine = new SpringTemplateEngine();
templateEngine.setTemplateResolver(templateResolver());
templateEngine.addDialect(new SpringSecurityDialect());
templateEngine.addDialect(new Java8TimeDialect());
return templateEngine;
}
@Bean
public ViewResolver viewResolver() {
ThymeleafViewResolver thymeleafViewResolver = new ThymeleafViewResolver();
thymeleafViewResolver.setTemplateEngine(templateEngine());
thymeleafViewResolver.setCharacterEncoding("UTF-8");
return thymeleafViewResolver;
}
@Component
public class CustomContainer implements
WebServerFactoryCustomizer<TomcatServletWebServerFactory> {
@Override
public void customize(TomcatServletWebServerFactory factory) {
factory.setContextPath("/wpat");
}
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/js/**")
.addResourceLocations("/resources/static/js/");
registry.addResourceHandler("/css/**")
.addResourceLocations("/resources/static/css/");
registry.addResourceHandler("/images/**")
.addResourceLocations("/resources/static/images/");
registry.addResourceHandler("/lang/**")
.addResourceLocations("/resources/static/lang/");
registry.addResourceHandler("/uploads/**")
.addResourceLocations("/resources/static/uploads/");
}
}