This week's book giveaways are in the Jython/Python and Object-Oriented programming forums.
We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Can Hibernate create Views in MySQL while doing Schema Update

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can hibernate create a view when I run the schema update as configured as
"<property name="hbm2ddl.auto">update</property> " in the Hibernate config file. I have a POJO mapped the same way as we do it for tables for the view I want to create with the columns that would be displayed in the view,

I got the following log output when i already created the view in MySQL:-

22:16:17,073 [INFO ] [hbm2ddl.DatabaseMetadata][getTableMetadata] [table not found: EPW3_USER_ACCTS]
22:16:17,073 [DEBUG] [hbm2ddl.SchemaUpdate][execute] [create table EPW3_USER_ACCTS (
USER_ID varchar(255) not null, NAME varchar(255), USER_NM varchar(255), MAIL_PASS tinyblob, MAIL_SRVR varchar(255), MAIL_ADDR varchar(255), MAIL_TOKEN varchar(255), ACCT_TYPE varchar(255), primary key (USER_ID))]
22:16:17,089 [ERROR] [hbm2ddl.SchemaUpdate][execute] [Unsuccessful: create table EPW3_USER_ACCTS (USER_ID varchar(255) not null, NAME varchar(255), USER_NM varchar(255), MAIL_PASS tinyblob, MAIL_SRVR varchar(255), MAIL_ADDR varchar(255), MAIL_TOKEN varchar(255), ACCT_TYPE varchar(255), primary key (USER_ID))]
22:16:17,105 [ERROR] [hbm2ddl.SchemaUpdate][execute] [Table 'epw3_user_accts' already exists]
22:16:17,105 [INFO ] [hbm2ddl.SchemaUpdate][execute] [schema update complete]

Now it first prints "table not found: EPW3_USER_ACCTS" then later prints "Table 'epw3_user_accts' already exists" when this is not a table but a view
 
Morning came much too soon and it brought along a friend named Margarita Hangover, and a tiny ad.
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!