Guest User

Untitled

a guest
Feb 20th, 2018
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.65 KB | None | 0 0
  1. 2015-06-05 18:10:12.382 INFO 5119 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@446b0224: startup date [Fri Jun 05 18:10:12 PDT 2015]; root of context hierarchy
  2. 2015-06-05 18:10:13.567 INFO 5119 --- [ main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
  3. 2015-06-05 18:10:13.588 INFO 5119 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
  4. name: default
  5. ...]
  6. 2015-06-05 18:10:13.648 INFO 5119 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {4.3.8.Final}
  7. 2015-06-05 18:10:13.649 INFO 5119 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
  8. 2015-06-05 18:10:13.651 INFO 5119 --- [ main] org.hibernate.cfg.Environment : HHH000021: Bytecode provider name : javassist
  9. 2015-06-05 18:10:13.804 INFO 5119 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {4.0.5.Final}
  10. 2015-06-05 18:10:14.086 INFO 5119 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect
  11. 2015-06-05 18:10:14.171 INFO 5119 --- [ main] o.h.h.i.ast.ASTQueryTranslatorFactory : HHH000397: Using ASTQueryTranslatorFactory
  12. 2015-06-05 18:10:14.365 INFO 5119 --- [ main] org.hibernate.tool.hbm2ddl.SchemaUpdate : HHH000228: Running hbm2ddl schema update
  13. 2015-06-05 18:10:14.365 INFO 5119 --- [ main] org.hibernate.tool.hbm2ddl.SchemaUpdate : HHH000102: Fetching database metadata
  14. 2015-06-05 18:10:14.366 INFO 5119 --- [ main] org.hibernate.tool.hbm2ddl.SchemaUpdate : HHH000396: Updating schema
  15. 2015-06-05 18:10:14.390 INFO 5119 --- [ main] o.hibernate.tool.hbm2ddl.TableMetadata : HHH000261: Table found: poo_test.Customer
  16. 2015-06-05 18:10:14.390 INFO 5119 --- [ main] o.hibernate.tool.hbm2ddl.TableMetadata : HHH000037: Columns: [id, lastname, firstname]
  17. 2015-06-05 18:10:14.390 INFO 5119 --- [ main] o.hibernate.tool.hbm2ddl.TableMetadata : HHH000108: Foreign keys: []
  18. 2015-06-05 18:10:14.391 INFO 5119 --- [ main] o.hibernate.tool.hbm2ddl.TableMetadata : HHH000126: Indexes: [primary]
  19. 2015-06-05 18:10:14.391 INFO 5119 --- [ main] org.hibernate.tool.hbm2ddl.SchemaUpdate : HHH000232: Schema update complete
  20. 2015-06-05 18:10:14.777 INFO 5119 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
  21. Customer found with findOne(1L):
  22. --------------------------------
  23. Customer[id=1, firstName='💩💩💩💩', lastName='💩💩💩💩']
  24.  
  25. 2015-06-05 18:10:14.836 INFO 5119 --- [ main] hello.Application : Started Application in 2.819 seconds (JVM running for 3.077)
  26. 2015-06-05 18:10:14.837 INFO 5119 --- [ Thread-1] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@446b0224: startup date [Fri Jun 05 18:10:12 PDT 2015]; root of context hierarchy
  27. 2015-06-05 18:10:14.838 INFO 5119 --- [ Thread-1] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
  28. 2015-06-05 18:10:14.839 INFO 5119 --- [ Thread-1] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
  29.  
  30. @SpringBootApplication
  31. public class Application implements CommandLineRunner {
  32.  
  33. @Autowired
  34. CustomerRepository repository;
  35.  
  36. public static void main(String[] args) {
  37. SpringApplication.run(Application.class);
  38. }
  39.  
  40. @Override
  41. public void run(String... strings) throws Exception {
  42. // save a couple of customers
  43. repository.save(new Customer("💩💩💩💩", "💩💩💩💩"));
  44.  
  45. // fetch all customers
  46. System.out.println("Customers found with findAll():");
  47. System.out.println("-------------------------------");
  48. for (Customer customer : repository.findAll()) {
  49. System.out.println(customer);
  50. }
  51. System.out.println();
  52.  
  53. // fetch an individual customer by ID
  54. Customer customer = repository.findOne(1L);
  55. System.out.println("Customer found with findOne(1L):");
  56. System.out.println("--------------------------------");
  57. System.out.println(customer);
  58. System.out.println();
  59.  
  60. }
  61.  
  62. }
  63.  
  64. spring:
  65.  
  66. datasource:
  67. url: "jdbc:mysql://localhost:3306/poo_test?useUnicode=yes&characterEncoding=utf8&characterResultSets=utf8"
  68. username: root
  69. password:
  70. connectionInitSqls: "SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;"
  71. driverClassName: com.mysql.jdbc.Driver
  72. testOnBorrow: true
  73. validationQuery: SELECT 1
  74.  
  75. jpa:
  76. show-sql: false
  77. database-platform: org.hibernate.dialect.MySQL5Dialect
  78. hibernate:
  79. ddl-auto: update
  80. naming_strategy: org.hibernate.cfg.EJB3NamingStrategy
  81. connection:
  82. CharSet: utf8mb4
  83. characterEncoding: utf8
  84. useUnicode: true
  85.  
  86. spring:
  87.  
  88. datasource:
  89. url: "jdbc:mysql://localhost:3306/poo_test?useUnicode=yes&characterEncoding=utf8"
  90. username: root
  91. password:
  92. initSQL: "SET NAMES 'utf8mb4'"
  93.  
  94. jpa:
  95. hibernate:
  96. ddl-auto: update
  97.  
  98. sudo nano /etc/mysql/my.cnf
  99.  
  100. character_set_server=utf8mb4
  101.  
  102. sudo /etc/init.d/mysqld restart
  103.  
  104. [client]
  105. default-character-set = utf8mb4
  106.  
  107. [mysql]
  108. default-character-set = utf8mb4
  109.  
  110. [mysqld]
  111. character-set-client-handshake = FALSE
  112. character-set-server = utf8mb4
  113. collation-server = utf8mb4_unicode_ci
Add Comment
Please, Sign In to add comment