Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8125163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:43:26+00:00 2026-06-06T06:43:26+00:00

I have about 8 entities that all have a one to one relationship with

  • 0

I have about 8 entities that all have a one to one relationship with a common entity.

The client is not choosing from pre-defined data so it is not necessary to apply a FK to be used as a constraint.

The main table in question is call a finish table and it contains four unknown hex colors that are sent from the client to the server.

For example, when a door is built the colors for the different parts of the door and it’s outer parts can all have different colors. So, all of these tables in question, their data is always fresh from the client and not chosen from a drop down, or from some other pre-defined data that I am given to the client to choose from.

My question is, what would be the best way to association this finish entity with the other entities that need a way to express their finish?

I am adding a screen shot of a diagram that I am working on, these are not all the entities and are just the ones in question right now and ones that will help articulate to others what I am needing a solution for.

I have also included some script as well.

    /****** Object:  Table [dbo].[Finish]    Script Date: 06/22/2012 15:08:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Finish](
    [ID] [int] NOT NULL,
    [Left] [varchar](30) NULL,
    [Right] [varchar](30) NULL,
    [Top] [varchar](30) NULL,
    [Bottom] [varchar](30) NULL,
    [Note] [varchar](150) NULL,
 CONSTRAINT [PK_Finish] PRIMARY KEY CLUSTERED 
(
    [ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Horizontal]    Script Date: 06/22/2012 15:08:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Horizontal](
    [ID] [int] IDENTITY(11,1) NOT NULL,
    [Name] [varchar](15) NOT NULL,
    [Floor] [smallint] NOT NULL,
    [SizeID] [int] NOT NULL,
    [GlassPocket] [decimal](5, 3) NULL,
    [IsFiller] [bit] NOT NULL,
    [Note] [varchar](150) NULL,
 CONSTRAINT [PK_Horizontal] PRIMARY KEY CLUSTERED 
(
    [ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Door]    Script Date: 06/22/2012 15:08:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Door](
    [ID] [int] IDENTITY(421,1) NOT NULL,
    [BayID] [int] NOT NULL,
    [Position] [tinyint] NOT NULL,
    [HasJamb] [bit] NOT NULL,
    [HasThreshold] [bit] NOT NULL,
    [IsAutoShowroom] [bit] NOT NULL,
    [IsSingle] [bit] NOT NULL,
    [Type] [varchar](10) NOT NULL,
    [SizeID] [int] NOT NULL,
    [Note] [varchar](150) NULL,
 CONSTRAINT [PK_Door] PRIMARY KEY CLUSTERED 
(
    [ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Leaf]    Script Date: 06/22/2012 15:08:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Leaf](
    [ID] [int] IDENTITY(21,1) NOT NULL,
    [DoorID] [int] NOT NULL,
    [Position] [tinyint] NOT NULL,
    [Stile] [varchar](10) NOT NULL,
    [Bottomrail] [decimal](5, 3) NOT NULL,
    [Hand] [varchar](5) NOT NULL,
    [IsActive] [bit] NOT NULL,
    [Swing] [varchar](5) NOT NULL,
    [SizeID] [int] NOT NULL,
    [Note] [varchar](150) NULL,
 CONSTRAINT [PK_Leaf] PRIMARY KEY CLUSTERED 
(
    [ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Bay]    Script Date: 06/22/2012 15:08:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Bay](
    [ID] [int] IDENTITY(1213,1) NOT NULL,
    [ElevationID] [int] NOT NULL,
    [Position] [tinyint] NOT NULL,
    [SizeID] [int] NOT NULL,
    [Note] [varchar](150) NULL,
 CONSTRAINT [PK_Bay] PRIMARY KEY CLUSTERED 
(
    [ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO

Each one of the entities below need to be associated with the finish table. Each entity new record has exactly one finish relationship.
Is it possible to associate these and still be able to do a Cascade On DELETE, with-out having a circular reference issues?

Schema Candidate

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T06:43:28+00:00Added an answer on June 6, 2026 at 6:43 am

    Yes, it’s possible.

    You would add a reference to Finish entity in each of the tables that has a relationship to it.

    You would define the column with the same datatype, (and normally) as the referenced_table_name and id. In our shop, the column_name would be [finish_id]. (I see here that you are using a CamelCase style.)

    At any rate, I would recommend you define this as a foreign key.

    You say there is no need to, but from what you describe, this is exactly the kind of situation that calls for a foreign key constraint.

    You need to decide on the action when the id in the finish table is updated or deleted. (Do you want to disallow the update or delete? Do you want to preserve existing relationship?) I expect you would want the default ON DELETE RESTRICT. You could allow for updates, and preserve the relationships, with ON UPDATE CASCADE.)

    I don’t see any potential problem with circular references, as long as the finish table will be the parent (all the other tables reference it, and the finish table doesn’t have any references to the other tables.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two entities that usually have one-to-many relationship, but in rare cases should
I have two linqTOsql entities that has a parent and child relationship, one to
I have about 20 grid views that I have to create. All of them
I have about 10 different entities in my J2EE application that right now share
I have 2 entities, A and B that have a many to many relationship.
I have core data model with two entities that have a many-to-many relationship with
i have about 20 possible exception messages that i want thrown when an error
I have about 10 drop down list controls that get populated. Instead of copying/pasting
In my Rails app I have a fairly standard has_many relationship between two entities.
I am a bit confused about managing relationship in JPA. basically I have two

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.