留言板
table without primary key column
Priyanka Dhingra,修改在11 年前。
table without primary key column
Liferay Master 帖子: 501 加入日期: 11-12-20 最近的帖子
I have a requirement to generate some tables without any primary column...
is that possible by service builder???
or any other way
Thanks in advance
Regards
Priyanka Dhingra
is that possible by service builder???
or any other way
Thanks in advance
Regards
Priyanka Dhingra
Hitoshi Ozawa,修改在11 年前。
RE: table without primary key column
Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
Can you give explanation on your situation?
I think you're not getting the fundamental design principle behind liferay.
I think you're not getting the fundamental design principle behind liferay.
Priyanka Dhingra,修改在11 年前。
RE: table without primary key column
Liferay Master 帖子: 501 加入日期: 11-12-20 最近的帖子
I have foriegn key in that table...would try to come up with the scenario in a diagram if still the case i mentioned doesnt satisfy
Priyanka Dhingra,修改在11 年前。
RE: table without primary key column
Liferay Master 帖子: 501 加入日期: 11-12-20 最近的帖子
Here is the sample diagram
in this in the state table we do not need a foriegn key.....
moreover , please suggest...if it is fine to use the
to establish the foriegn key reference relation??
in this in the state table we do not need a foriegn key.....
moreover , please suggest...if it is fine to use the
<column name="if_service" type="Collection" mapping-key="id" entity="activity" />
to establish the foriegn key reference relation??
Priyanka Dhingra,修改在11 年前。
RE: table without primary key column
Liferay Master 帖子: 501 加入日期: 11-12-20 最近的帖子
Hope I can get a quick answer
Priyanka Dhingra,修改在11 年前。
RE: table without primary key column
Liferay Master 帖子: 501 加入日期: 11-12-20 最近的帖子
Any help
David H Nebinger,修改在11 年前。
RE: table without primary key column
Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
Yes, you should go an hire yourself a DBA because you clearly don't understand DB concepts.
If you did, you would realize that your PK on the table is actually ID_SERVICE and ID_ACTIVITY. Doesn't matter that they are foreign keys also, they are the values that will identify a unique row that represents a single relationship between the activity and service table.
If you did, you would realize that your PK on the table is actually ID_SERVICE and ID_ACTIVITY. Doesn't matter that they are foreign keys also, they are the values that will identify a unique row that represents a single relationship between the activity and service table.
Priyanka Dhingra,修改在11 年前。
RE: table without primary key column
Liferay Master 帖子: 501 加入日期: 11-12-20 最近的帖子
right
thanks David...
thanks David...
Hi Priyanka,
There should be a unique key in each table to fetch any row uniquely.
From the diagram posted by you, i understood that there might be many-to-many relationship between activity and service tables that's why a new table state has been created.
Now there are foreign key of activity table(id_activity) and service table(id_service) in the state table. Now here we should have a unique key in the state table and that unique key can be primary key or composite key ( id_activity + id_service).
So, i will say that in the current diagram you are not seeing the id ( i.e. primary key) so you might have the doubt about the primary key but here the design says that you should have composite key using id_activity and id_service.
Regards,
Ajeet Singh
There should be a unique key in each table to fetch any row uniquely.
From the diagram posted by you, i understood that there might be many-to-many relationship between activity and service tables that's why a new table state has been created.
Now there are foreign key of activity table(id_activity) and service table(id_service) in the state table. Now here we should have a unique key in the state table and that unique key can be primary key or composite key ( id_activity + id_service).
So, i will say that in the current diagram you are not seeing the id ( i.e. primary key) so you might have the doubt about the primary key but here the design says that you should have composite key using id_activity and id_service.
Regards,
Ajeet Singh
Priyanka Dhingra,修改在11 年前。
RE: table without primary key column
Liferay Master 帖子: 501 加入日期: 11-12-20 最近的帖子
Thanks for replying Ajeet.. I hope now I can work with my service builder with this er diagram
Priyanka Dhingra,修改在11 年前。
RE: table without primary key column
Liferay Master 帖子: 501 加入日期: 11-12-20 最近的帖子
thanks ajeet for the hint...
and i got solution to define a composite key like following in my service builder
<column name="id_service" primary="true" type="long" />
<column name="id_activity" primary="true" type="long" />
and i got solution to define a composite key like following in my service builder
<column name="id_service" primary="true" type="long" />
<column name="id_activity" primary="true" type="long" />