This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- MAKE SURE TO ADD DATABASE DEPENDENCY IN POM.XML --> | |
# H2 | |
spring.datasource.url=jdbc:h2:file:C:/temp/test | |
spring.datasource.username=sa | |
spring.datasource.password= | |
spring.datasource.driverClassName=org.h2.Driver | |
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect | |
# MySQL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Make life easier with this simple step!! | |
* | |
* Create an interface that extends one of your Entity classes | |
* Then import the following below, after your entity class name | |
*/ | |
import org.springframework.data.repository.CrudRepository; | |
public interface EntityClass extends CrudRepository<EntityClass> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<persistence xmlns="http://java.sun.com/xml/ns/persistence" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence | |
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" | |
version="1.0"> | |
<!-- derby --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version = "1.0" encoding = "utf-8"?> | |
<!DOCTYPE hibernate-configuration SYSTEM | |
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> | |
<hibernate-configuration> | |
<session-factory> | |
<property name = "hibernate.dialect"> | |
org.hibernate.dialect.MySQLDialect | |
</property> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Right click WEB-INF folder | NEW | FILE | |
name file dispatcher.xml || dispatcher.servlet.xml | |
insert the follow code; | |
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<persistence version="2.1" | |
xmlns="http://xmlns.jcp.org/xml/ns/persistence" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> | |
<persistence-unit name="any-name-you-want-here"> | |
<!-- The persistence-unit name can be whatever you like --> | |
<!-- This is the BRAIN of our project --> | |
<!-- ADD (CLASSES) ENTITIES /OR MODELS CREATED FOR BY ME FOR MY APP --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence | |
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd" | |
version="2.2"> | |
<persistence-unit name="org.hibernate.example.jpa" transaction-type="RESOURCE_LOCAL"> | |
<provider>org.hibernate.ejb.HibernatePersistence</provider> | |
<class>org.packagename.classname</class> <!-- add each new created package name below this --> |