daily pastebin goal
8%
SHARE
TWEET

Untitled

a guest Apr 21st, 2018 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @Entity
  2. @Table(name="NICKNAME")
  3. public class NickName {
  4.    
  5. spring.datasource.url=jdbc:postgresql://192.168.239.129:5432/maindb
  6. spring.datasource.username=pgdbuser
  7. spring.datasource.password=pgdbuser
  8. spring.jpa.generate-ddl=false
  9. spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext
  10. logging.level.org.springframework.web=DEBUG
  11. logging.level.org.hibernate=DEBUG
  12. spring.jpa.properties.hibernate.show_sql=true
  13. spring.jpa.properties.hibernate.use_sql_comments=true
  14. spring.jpa.properties.hibernate.format_sql=true
  15. spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL82Dialect
  16. spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
  17.    
  18. import java.io.Serializable;
  19.  
  20. import org.apache.commons.lang.StringUtils;
  21. import org.hibernate.boot.model.naming.Identifier;
  22. import org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl;
  23. import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment;
  24.  
  25. public class PhysicalNamingStrategyImpl extends PhysicalNamingStrategyStandardImpl implements Serializable{
  26.  
  27.     public static final PhysicalNamingStrategyImpl INSTANCE = new PhysicalNamingStrategyImpl();
  28.  
  29.     @Override
  30.     public Identifier toPhysicalTableName(Identifier name, JdbcEnvironment context) {
  31.          String nameModified = StringUtils.upperCase(name.getText());
  32.  
  33.         // Do whatever you want with the name modification
  34.         return new Identifier(nameModified, name.isQuoted());
  35.     }
  36.  
  37.  
  38.     @Override
  39.     public Identifier toPhysicalColumnName(Identifier name, JdbcEnvironment context) {
  40.         String nameModified = StringUtils.upperCase(name.getText());
  41.  
  42.         // Do whatever you want with the name modification
  43.         return new Identifier(nameModified, name.isQuoted());
  44.     }
  45.  
  46. }
  47.    
  48. org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
  49.     at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:242) ~[spring-orm-5.0.5.RELEASE.jar:5.0.5.RELEASE]
  50.     at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:225) ~[spring-orm-5.0.5.RELEASE.jar:5.0.5.RELEASE]
  51.     at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:527) ~[spring-orm-5.0.5.RELEASE.jar:5.0.5.RELEASE]
  52. ......
  53. Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
  54.     at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:106) ~[hibernate-core-5.2.16.Final.jar:5.2.16.Final]
  55.     at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42) ~[hibernate-core-5.2.16.Final.jar:5.2.16.Final]
  56.     at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111) ~[hibernate-core-5.2.16.Final.jar:5.2.16.Final]
  57. .......
  58. Caused by: org.postgresql.util.PSQLException: ERROR: relation "nickname" does not exist
  59.   Position: 460
  60.     at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433) ~[postgresql-42.2.2.jar:42.2.2]
  61.     at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2178) ~[postgresql-42.2.2.jar:42.2.2]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top