Java Hibernate继承映射中独立表中的鉴别器值
我有两个表,Java Hibernate继承映射中独立表中的鉴别器值,java,hibernate,inheritance,discriminator,Java,Hibernate,Inheritance,Discriminator,我有两个表,price\u feed和price\u feed\u type。Price提要将包含Price提要的不同实现的数据 现在,这通常是通过标记完成的,在price\u feed表中有一个鉴别器字段。但是,在系统上下文中,最好在price\u feed\u type表中包含此字段。我遇到了方法,并尝试使用此方法 一种解决方案如下(假设这是在公式属性中输入的): 另一个解决方案如下,我应该注意,我已经尝试了priceFeedID和price\u feed.price\u feed\u ty
price\u feed
和price\u feed\u type
。Price提要将包含Price提要的不同实现的数据
现在,这通常是通过
标记完成的,在price\u feed
表中有一个鉴别器字段。但是,在系统上下文中,最好在price\u feed\u type
表中包含此字段。我遇到了
方法,并尝试使用此方法
一种解决方案如下(假设这是在公式
属性中输入的):
另一个解决方案如下,我应该注意,我已经尝试了priceFeedID
和price\u feed.price\u feed\u type\u id
(SELECT implementing_class FROM price_feed_type WHERE price_feed_type.price_feed_type_id = price_feed.price_feed_type)
任何一个都会出现以下错误:
org.postgresql.util.PSQLException: ERROR: column timedprice3_.implementing_class does not exist
另外一个注意事项是,如果没有偏执,我会得到错误:
org.postgresql.util.PSQLException: ERROR: syntax error at or near "SELECT"
有没有办法解决这个问题
编辑:
要添加到目前为止我发现的内容:
使用这两种方法中的任何一种,如果我选择*,然后在外部执行选择实现类
,则会给出不同的错误。完整代码:
(SELECT implementing_class FROM (SELECT * FROM price_feed_type INNER JOIN price_feed ON price_feed.price_feed_type_id = price_feed_type.price_feed_type_id) AS foo)
错误是:
org.postgresql.util.PSQLException: ERROR: syntax error at or near "."
org.postgresql.util.PSQLException: ERROR: syntax error at or near "."