Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Aphorismen
Applications
Business Economics & Admin.
My Computers
Cooking
Devices
Folders
Food
Hardware
Infos
Software Development
Sports
Operation Instructions
Todos
Test
Help
Glossary
Community portal
adaptions
Sidebar anpassen
Wiki RB4
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
SpringBoot
(section)
Page
Discussion
English
Read
Edit
View history
Toolbox
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Examples== Some examples are not available anymore due to the loss of the Eon laptop. ===[[Heroku#Spring_Boot_Demo|Demo project local and on Heroku]]=== ===Test1=== * for Raspberry 4 # create app with Sprint Initialzr [[File:SpringBootTest1_1.PNG|400px]] # copy test1.zip to <code>C:\Uwes\eclipse\workspace_2020-12\SpringBoot</code> # extract it, which creates a test1 directory # import as Maven project and select root directory ===Test2=== * for Raspberry * export productive DB content of DB mysql506 via https://uweheuer.spdns.de/phpxmyadmin to C:\Uwes\Backup\Raspberry (incl. drop statements) * import after starting xampp via http://localhost:8090/phpmyadmin Then # use wizzard of [[Eclipse#Spring_Tools|Eclipse Spring Tools]] # File -> New -> Other -> Spring Starter Project # [[File:SpringBootTest2_1.PNG|400px]] # [[File:SpringBootTest2_2.PNG|400px]] # in order to use JPA Tools (according to [https://stackoverflow.com/questions/50817803/jpa-tools-menu-missing-from-eclipse here]) right click project -> Configure -> Convert to JPA Project ## [[File:SpringBootTest2_3.PNG|400px]] ## [[File:SpringBootTest2_4.PNG|400px]] # RC project -> JAP Tools -> Generate entities from tables # Run As 'Spring Boot App' ===Test3=== * creation with eclipse wizzard like [[#Test2|Test 2]] * identified ** not encrypted urls in productive DB ** change to menu can be null, because urls can exist w/o menu (set by PHPAdmin in DB) ===Udemy Course=== * [[File:SpringBoot2.PNG|800px]] * start eclipse * File -> Import -> Maven Project ===Bookmarks=== * [[File:SpringBootBookmarks.PNG|400px]] * start eclipse * File -> Import -> Maven -> Existing Maven Projects * select <code>C:\Uwes\eclipse\workspace_2020-12\SpringBoot\bookmarks</code> ====Database Configuration==== The default is that the datasource url is generated randomly and printed to the console. The default user is 'sa', default password is empty. * in [[#Application_Properties|application.properties]] spring.profiles.active=[dev|laptopmysql|raspberry] * and created in <code>\bookmarks\src\main\resources\</code> dedicated property files <code>application-[dev|laptopmysql|raspberry].properties</code> =====H2 Database Configuration===== * see <code>application-dev.properties</code> # to make the h2 database url constant, otherwise it is a random url spring.datasource.url=jdbc:h2:mem:bookmarksdb # user and password for H2 console spring.datasource.username=uwe spring.datasource.password=uwe =====Test Data for Startup===== * in <CODE><PROJECT_DIR>/src/main/resources/data.sql</CODE> ====Links==== * see My Bookmarks -> Web-Präsenz -> localhost -> SpringBoot -> Bookmarks ====ToDos==== * JSON rest APIs ** [https://www.logicbig.com/tutorials/misc/jackson/json-identity-info-annotation.html @JsonIdentityInfo] ** [https://spring.io/blog/2014/12/02/latest-jackson-integration-improvements-in-spring @JSonView] * adjust maven build ** https://riptutorial.com/spring-boot/example/31100/set-the-right-spring-profile-by-building-the-application-automatically--maven- * build entities **The @ManyToOne association uses FetchType.LAZY because, otherwise, we’d fall back to EAGER fetching which is bad for performance. * https://thorben-janssen.com/ultimate-guide-derived-queries-with-spring-data-jpa/ Query Documentation] ** Sorted Lists *** http://assarconsulting.blogspot.com/2009/08/why-hibernate-does-delete-all-then-re.html *** https://stackoverflow.com/questions/13101882/jpa-onetomany-list-vs-set/29562678 *** https://www.google.com/search?q=jpa+onetomany+list+or+set&rlz=1C1GCEU_deDE848DE867&ei=-iFTYO3XHJWj1fAPw5mgqAM&oq=JPA+%40one2many+list&gs_lcp=Cgdnd3Mtd2l6EAEYATIGCAAQFhAeMgYIABAWEB4yBggAEBYQHjIGCAAQFhAeMgYIABAWEB4yBggAEBYQHjIGCAAQFhAeMgYIABAWEB4yBggAEBYQHjIGCAAQFhAeOgcIABBHELADOggIABAWEAoQHlDLIViCJWC1UmgCcAJ4AIABhgGIAdkDkgEDNC4xmAEAoAEBqgEHZ3dzLXdpesgBCMABAQ&sclient=gws-wiz
Summary:
Please note that all contributions to Wiki RB4 may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Uwe Heuer Wiki New:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Toggle limited content width