Error creating bean with name entityManagerFactory defined in class path resource

ERROR 4104 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
Caused by: java.lang.reflect.InvocationTargetException: null
Caused by: java.lang.NullPointerException: null

hibernate 의존성이 누락되어서 발생한 오류이므로 hibernate-core와 hibernate-entitymanager 의존성을 pom.xml에 추가한다.

<dependency>
  <groupId>org.hibernate</groupId>
  <artifactId>hibernate-core</artifactId>
  <version>5.3.6.Final</version>
</dependency>
<dependency>
  <groupId>org.hibernate</groupId>
  <artifactId>hibernate-entitymanager</artifactId>
  <version>5.3.6.Final</version>
</dependency>

1 / 1 / 0

Регистрация: 26.09.2015

Сообщений: 217

1

08.04.2022, 20:43. Показов 1285. Ответов 1


Здраствуйте, я хочу собрать программу с двумя таблицами
обе таблицы используют manytomany.

выбрасывается данный стэк ошибок
Код прогаммы внизу после списка ошибок
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: Associations marked as mappedBy must not define database mappings like @JoinTable or @JoinColumn: com.examplesector.choosesectors.models.Entity.Sect or.persons
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1804) ~[spring-beans-5.3.18.jar:5.3.18]
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:620) ~[spring-beans-5.3.18.jar:5.3.18]
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:542) ~[spring-beans-5.3.18.jar:5.3.18]
at org.springframework.beans.factory.support.Abstract BeanFactory.lambda$doGetBean$0(AbstractBeanFactory .java:335) ~[spring-beans-5.3.18.jar:5.3.18]
at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:234) ~[spring-beans-5.3.18.jar:5.3.18]
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:333 ) ~[spring-beans-5.3.18.jar:5.3.18]
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.18.jar:5.3.18]
at org.springframework.context.support.AbstractApplic ationContext.getBean(AbstractApplicationContext.ja va:1154) ~[spring-context-5.3.18.jar:5.3.18]
at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:908) ~[spring-context-5.3.18.jar:5.3.18]
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:583) ~[spring-context-5.3.18.jar:5.3.18]
at org.springframework.boot.web.servlet.context.Servl etWebServerApplicationContext.refresh(ServletWebSe rverApplicationContext.java:145) ~[spring-boot-2.5.13-20220407.211259-10.jar:2.5.13-SNAPSHOT]
at org.springframework.boot.SpringApplication.refresh (SpringApplication.java:775) ~[spring-boot-2.5.13-20220407.211259-10.jar:2.5.13-SNAPSHOT]
at org.springframework.boot.SpringApplication.refresh Context(SpringApplication.java:448) ~[spring-boot-2.5.13-20220407.211259-10.jar:2.5.13-SNAPSHOT]
at org.springframework.boot.SpringApplication.run(Spr ingApplication.java:339) ~[spring-boot-2.5.13-20220407.211259-10.jar:2.5.13-SNAPSHOT]
at org.springframework.boot.SpringApplication.run(Spr ingApplication.java:1365) ~[spring-boot-2.5.13-20220407.211259-10.jar:2.5.13-SNAPSHOT]
at org.springframework.boot.SpringApplication.run(Spr ingApplication.java:1354) ~[spring-boot-2.5.13-20220407.211259-10.jar:2.5.13-SNAPSHOT]
at com.examplesector.choosesectors.ChooseSectorsAppli cation.main(ChooseSectorsApplication.java:10) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invo ke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invo ke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl. invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.boot.devtools.restart.RestartL auncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-2.5.13-20220407.211259-10.jar:2.5.13-SNAPSHOT]
Caused by: org.hibernate.AnnotationException: Associations marked as mappedBy must not define database mappings like @JoinTable or @JoinColumn: com.examplesector.choosesectors.models.Entity.Sect or.persons
at org.hibernate.cfg.annotations.CollectionBinder.bin d(CollectionBinder.java:542) ~[hibernate-core-5.4.33.jar:5.4.33]
at org.hibernate.cfg.AnnotationBinder.processElementA nnotations(AnnotationBinder.java:2204) ~[hibernate-core-5.4.33.jar:5.4.33]
at org.hibernate.cfg.AnnotationBinder.processIdProper tiesIfNotAlready(AnnotationBinder.java:979) ~[hibernate-core-5.4.33.jar:5.4.33]
at org.hibernate.cfg.AnnotationBinder.bindClass(Annot ationBinder.java:806) ~[hibernate-core-5.4.33.jar:5.4.33]
at org.hibernate.boot.model.source.internal.annotatio ns.AnnotationMetadataSourceProcessorImpl.processEn tityHierarchies(AnnotationMetadataSourceProcessorI mpl.java:248) ~[hibernate-core-5.4.33.jar:5.4.33]
at org.hibernate.boot.model.process.spi.MetadataBuild ingProcess$1.processEntityHierarchies(MetadataBuil dingProcess.java:239) ~[hibernate-core-5.4.33.jar:5.4.33]
at org.hibernate.boot.model.process.spi.MetadataBuild ingProcess.complete(MetadataBuildingProcess.java:2 82) ~[hibernate-core-5.4.33.jar:5.4.33]
at org.hibernate.jpa.boot.internal.EntityManagerFacto ryBuilderImpl.metadata(EntityManagerFactoryBuilder Impl.java:1224) ~[hibernate-core-5.4.33.jar:5.4.33]
at org.hibernate.jpa.boot.internal.EntityManagerFacto ryBuilderImpl.build(EntityManagerFactoryBuilderImp l.java:1255) ~[hibernate-core-5.4.33.jar:5.4.33]
at org.springframework.orm.jpa.vendor.SpringHibernate JpaPersistenceProvider.createContainerEntityManage rFactory(SpringHibernateJpaPersistenceProvider.jav a:58) ~[spring-orm-5.3.18.jar:5.3.18]
at org.springframework.orm.jpa.LocalContainerEntityMa nagerFactoryBean.createNativeEntityManagerFactory( LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.3.18.jar:5.3.18]
at org.springframework.orm.jpa.AbstractEntityManagerF actoryBean.buildNativeEntityManagerFactory(Abstrac tEntityManagerFactoryBean.java:409) ~[spring-orm-5.3.18.jar:5.3.18]
at org.springframework.orm.jpa.AbstractEntityManagerF actoryBean.afterPropertiesSet(AbstractEntityManage rFactoryBean.java:396) ~[spring-orm-5.3.18.jar:5.3.18]
at org.springframework.orm.jpa.LocalContainerEntityMa nagerFactoryBean.afterPropertiesSet(LocalContainer EntityManagerFactoryBean.java:341) ~[spring-orm-5.3.18.jar:5.3.18]
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.18.jar:5.3.18]
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.18.jar:5.3.18]
... 21 common frames omitted

Java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.examplesector.choosesectors.controllers;
 
import com.examplesector.choosesectors.models.Entity.Sector;
import com.examplesector.choosesectors.repository.SectorRepository;
import com.examplesector.choosesectors.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
 
@Controller
public class ChooseSectorsContorller {
    @Autowired
    SectorRepository sectorRepository;
 
    @Autowired
    UserRepository userRepository;
 
    @GetMapping("/readSectors")
    public String readSectors(Model model){
        Iterable<Sector> sectors = sectorRepository.findAll();
        model.addAttribute("sectors", sectors);
        return "index-2";
    }
 
}

Java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.examplesector.choosesectors.models.Entity;
 
import lombok.*;
 
import javax.persistence.*;
import javax.validation.constraints.Size;
import java.util.List;
import java.util.Objects;
 
@Entity
@Data
public class Person {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private String name;
    @ManyToMany(cascade = {CascadeType.ALL})
    @JoinTable(name = "Choosed_sector",
    joinColumns = {@JoinColumn(name = "USER_ID")},
    inverseJoinColumns = {@JoinColumn(name = "SECTOR_ID")})
    private List<Sector> sectors;
    private Boolean checkedAgreeToTerms;
 
 
}

Java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package com.examplesector.choosesectors.models.Entity;
 
import lombok.*;
 
import javax.persistence.*;
import javax.validation.constraints.Size;
import java.util.List;
import java.util.Objects;
 
@Entity
@Data
public class Sector {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private String nameSector;
    private String group;
 
    @ManyToMany(mappedBy = "sectors")
    @JoinColumn(name = "PERSON_ID")
    private List<Person> persons;
 
 
}

Java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package com.examplesector.choosesectors.models.Entity;
 
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
 
import javax.persistence.*;
import javax.validation.constraints.NotNull;
 
@SuppressWarnings("PMD")
@ToString
@Entity
@Table(name = "users")
@Getter
@Setter
public class User {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
}

Java

1
2
3
4
5
6
7
package com.examplesector.choosesectors.repository;
 
import com.examplesector.choosesectors.models.Entity.Sector;
import org.springframework.data.repository.CrudRepository;
 
public interface SectorRepository extends CrudRepository<Sector, Long> {
}

Java

1
2
3
4
5
6
7
package com.examplesector.choosesectors.repository;
 
import com.examplesector.choosesectors.models.Entity.Person;
import org.springframework.data.repository.CrudRepository;
 
public interface UserRepository extends CrudRepository<Person, Long> {
}

index-2 еще не реализован, должен соответсвовать index-1

HTML5

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm//dist/css/bootstrap.min.css">
</head>
<body>
<p>Please enter your name and pick the Sectors you are currently involved in.</p>
<p>Name:  <input type="text"> </p>
<div class="container mt-5">
       <select name="Sector: " multiple="" size="5" required="required">
           <option th:each="el : ${sectors}" th:value="${el.getId()}" th:text="${el.getNameSector()}"></option>
       </select>
</div>
 
 
</body>
</html>

index-1

HTML5

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!-- saved from url=(0094)file:///C:/Users/oliver.stimmer/AppData/Roaming/Skype/My%20Skype%20Received%20Files/index.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"></head>
<body>Please enter your name and pick the Sectors you are currently involved in.
<br>
<br>
Name: 
<input type="text">
<br>
<br>
Sectors: 
<select multiple="" size="5">
    <option value="1">Manufacturing</option>
    <option value="19">&nbsp;&nbsp;&nbsp;&nbsp;Construction materials</option>
    <option value="18">&nbsp;&nbsp;&nbsp;&nbsp;Electronics and Optics</option>
    <option value="6">&nbsp;&nbsp;&nbsp;&nbsp;Food and Beverage</option>
    <option value="342">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bakery &amp; confectionery products</option>
    <option value="43">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Beverages</option>
    <option value="42">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fish &amp; fish products </option>
    <option value="40">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Meat &amp; meat products</option>
    <option value="39">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Milk &amp; dairy products </option>
    <option value="437">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Other</option>
    <option value="378">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sweets &amp; snack food</option>
    <option value="13">&nbsp;&nbsp;&nbsp;&nbsp;Furniture</option>
    <option value="389">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bathroom/sauna </option>
    <option value="385">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bedroom</option>
    <option value="390">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Children’s room </option>
    <option value="98">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Kitchen </option>
    <option value="101">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Living room </option>
    <option value="392">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Office</option>
    <option value="394">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Other (Furniture)</option>
    <option value="341">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Outdoor </option>
    <option value="99">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Project furniture</option>
    <option value="12">&nbsp;&nbsp;&nbsp;&nbsp;Machinery</option>
    <option value="94">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Machinery components</option>
    <option value="91">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Machinery equipment/tools</option>
    <option value="224">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Manufacture of machinery </option>
    <option value="97">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Maritime</option>
    <option value="271">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Aluminium and steel workboats </option>
    <option value="269">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Boat/Yacht building</option>
    <option value="230">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ship repair and conversion</option>
    <option value="93">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Metal structures</option>
    <option value="508">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Other</option>
    <option value="227">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Repair and maintenance service</option>
    <option value="11">&nbsp;&nbsp;&nbsp;&nbsp;Metalworking</option>
    <option value="67">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construction of metal structures</option>
    <option value="263">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Houses and buildings</option>
    <option value="267">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Metal products</option>
    <option value="542">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Metal works</option>
    <option value="75">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CNC-machining</option>
    <option value="62">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Forgings, Fasteners </option>
    <option value="69">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gas, Plasma, Laser cutting</option>
    <option value="66">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MIG, TIG, Aluminum welding</option>
    <option value="9">&nbsp;&nbsp;&nbsp;&nbsp;Plastic and Rubber</option>
    <option value="54">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Packaging</option>
    <option value="556">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Plastic goods</option>
    <option value="559">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Plastic processing technology</option>
    <option value="55">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Blowing</option>
    <option value="57">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Moulding</option>
    <option value="53">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Plastics welding and processing</option>
    <option value="560">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Plastic profiles</option>
    <option value="5">&nbsp;&nbsp;&nbsp;&nbsp;Printing </option>
    <option value="148">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Advertising</option>
    <option value="150">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Book/Periodicals printing</option>
    <option value="145">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Labelling and packaging printing</option>
    <option value="7">&nbsp;&nbsp;&nbsp;&nbsp;Textile and Clothing</option>
    <option value="44">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Clothing</option>
    <option value="45">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Textile</option>
    <option value="8">&nbsp;&nbsp;&nbsp;&nbsp;Wood</option>
    <option value="337">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Other (Wood)</option>
    <option value="51">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Wooden building materials</option>
    <option value="47">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Wooden houses</option>
    <option value="3">Other</option>
    <option value="37">&nbsp;&nbsp;&nbsp;&nbsp;Creative industries</option>
    <option value="29">&nbsp;&nbsp;&nbsp;&nbsp;Energy technology</option>
    <option value="33">&nbsp;&nbsp;&nbsp;&nbsp;Environment</option>
    <option value="2">Service</option>
    <option value="25">&nbsp;&nbsp;&nbsp;&nbsp;Business services</option>
    <option value="35">&nbsp;&nbsp;&nbsp;&nbsp;Engineering</option>
    <option value="28">&nbsp;&nbsp;&nbsp;&nbsp;Information Technology and Telecommunications</option>
    <option value="581">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Data processing, Web portals, E-marketing</option>
    <option value="576">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Programming, Consultancy</option>
    <option value="121">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Software, Hardware</option>
    <option value="122">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Telecommunications</option>
    <option value="22">&nbsp;&nbsp;&nbsp;&nbsp;Tourism</option>
    <option value="141">&nbsp;&nbsp;&nbsp;&nbsp;Translation services</option>
    <option value="21">&nbsp;&nbsp;&nbsp;&nbsp;Transport and Logistics</option>
    <option value="111">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Air</option>
    <option value="114">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rail</option>
    <option value="112">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Road</option>
    <option value="113">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Water</option>
</select>
 
<br>
<br>
<input type="checkbox"> Agree to terms
 
<br>
<br>
<input type="submit" value="Save"></body></html>

server.port=8082
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/dbsector?useUnicode=true&serverTimezone=UTC&useSSL =true&verifyServerCertificate=false
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
#spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy
#spring.jpa.properties.hibernate.id.new_generator_ mappings=true
#spring.jpa.properties.hibernate.jdbc.lab.non_cont extual_creation=true

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь

0

How do I fix Error creating bean with name EntityManagerFactory?

Error creating bean with name 'entityManagerFactory' defined in class path resource. Resolved this error by adding a Bean to the main application class.

What is EntityManagerFactory in Java?

Several entity manager factories can be prepared for connecting to different data stores. JPA EntityManager is used to access a database in a particular application. It is used to manage persistent entity instances, to find entities by their primary key identity, and to query over all entities.

How do you make EntityManagerFactory beans in spring?

We can configure the entity manager factory bean by following these steps:.
Create a new LocalContainerEntityManagerFactoryBean object. ... .
Configure the used datasource..
Configure the Hibernate specific implementation of the JpaVendorAdapter interface. ... .
Configure the packages that are scanned for entity classes..

How do I use EntityManagerFactory in spring boot?

JPA EntityManager..
JPA EntityManager example with Spring Boot..
Create & Setup Spring Boot project..
Configure Spring Datasource, JPA, Hibernate..
Create Entity..
Define Repository with JPA EntityManager..
JPA EntityManager createQuery..
JPA EntityManager query with parameters..