• Post Reply Bookmark Topic Watch Topic
  • New Topic

cant understand the send table ie filter_filters  RSS feed

 
eugene malcolumn
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

above is the output code

the classes are




posted data



<b>cant understand the second table</b>
 
eugene malcolumn
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


 
eugene malcolumn
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
eugene malcolumn wrote:



i dont know why these images are not visible
 
eugene malcolumn
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


 
Dave Tolls
Ranch Hand
Posts: 2563
27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you explain what your issue is?
Those screenshots don't really help.
 
eugene malcolumn
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave Tolls wrote:Can you explain what your issue is?
Those screenshots don't really help.

NOT ABLE TO UNDERSTAND HOW hibernate created that second screen shot table its ddl is as follows

CREATE TABLE `filter_filters` (
  `filter_group_filterid` bigint(20) NOT NULL,
  `filters_filterid` bigint(20) NOT NULL,
  UNIQUE KEY `UK_rsa1av2x642tgpa22y27miqt5` (`filters_filterid`),
  KEY `FKnnui937n1nqplxnblb0kbmqi9` (`filter_group_filterid`),
  CONSTRAINT `FKfipmxo5r7r5xpis68afxqs1tg` FOREIGN KEY (`filters_filterid`) REFERENCES `filter` (`filterid`),
  CONSTRAINT `FKnnui937n1nqplxnblb0kbmqi9` FOREIGN KEY (`filter_group_filterid`) REFERENCES `filter` (`filterid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
 
Dave Tolls
Ranch Hand
Posts: 2563
27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I assume its based around this:

That would result in a Filter referencing multiple other filters.
 
eugene malcolumn
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave Tolls wrote:I assume its based around this:

That would result in a Filter referencing multiple other filters.


whats the logic behind creation of tables by hibernate?
 
Dave Tolls
Ranch Hand
Posts: 2563
27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I expect there's something in the docs.
I'm not too sure why it thought it ought to create a mapping table.

Actually, thinking about it, isn't this actually a many to many?
If a single Filter (in the form of a FilterGroup) can map to many Filters, those Filters are (by their nature) mapped in reverse to the original Filter.

In fact, looking at your model, I think your model is not quite right.
If a FilterGroup is a collection of Filters, then why are you extending Filter?
That seems to me to be the base of the problem.
It may be correct, but it looks a bit odd to me.
 
eugene malcolumn
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave Tolls wrote:I expect there's something in the docs.
I'm not too sure why it thought it ought to create a mapping table.

Actually, thinking about it, isn't this actually a many to many?
If a single Filter (in the form of a FilterGroup) can map to many Filters, those Filters are (by their nature) mapped in reverse to the original Filter.

In fact, looking at your model, I think your model is not quite right.
If a FilterGroup is a collection of Filters, then why are you extending Filter?
That seems to me to be the base of the problem.
It may be correct, but it looks a bit odd to me.


we are extending filter because in list<filtergroups> we want to have both types filters and filtergroups
 
Dave Tolls
Ranch Hand
Posts: 2563
27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That doesn't entirely make sense to me, but it's your model.

Anyway, that's the reason it has a mapping table, as it is essentially a many to many.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!