hibernate - Inheriting in domain GORM classes -


domain classes:

class carnet extends purchasable{     payment payment }  class training extends purchasable{     static hasmany = [payments:payment] }  class payment {     static belongsto = [purchase:purchasable] }  class purchasable {      float price      static constraints = {     }      static mapwith = "none"      static mapping = {     tableperhierarchy false     } } 

unfortunatelly when try grails run-app i've got:

error org.hibernate.tool.hbm2ddl.schemaupdate - hhh000388: unsuccessful: alter table payment add constraint fk_6ohgqce5txqxe8l8wkkkgjlc0 foreign key (purchase_id) references training (id)

error org.hibernate.tool.hbm2ddl.schemaupdate - can't write; duplicate key in table '#sql-690_99'

application starting carnet table in db not created later receive mysql exceptions. purchasable table created (and not need @ all). tried move purchasable interface src/groovy i'm not sure how properly. know how fix it?


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -