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 795433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:28:48+00:00 2026-05-14T22:28:48+00:00

I have an application where I have a generic object (table) called Hull. Each

  • 0

I have an application where I have a generic object (table) called Hull. Each hull in the table is unique.

I have another object that has three hulls, but they are specifically the Port_Hull, Center_Hull and Starboard_Hull.

Rather than create a One to Many relationship, I was trying to create a one to one relationship for each one, but this results in numerous errors unless I make the relationship from Hull to Vessel one to many (which it is not). Any idea how I go about this, or should I abandon the concept and make the vessel to hull relationship one to many and deal with lists that always have three entries?

p.s. Using uniqueidentifiers as many users can be adding records while disconnected.

Hull Table

  • HullID uniqueidentifier (primary key)
  • plus bunch of hull data fields

Vessel Table

  • VesselID uniqueidentifier (primary key)
  • MainHullID uniqueidentifier (tried as key and non-key)
  • PortHullID uniqueidentifier
  • StarboardHullID uniqueidentifier
  • plus bunch of Vessel data fields
  • 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-05-14T22:28:48+00:00Added an answer on May 14, 2026 at 10:28 pm

    You can solve this 1:1 in two different ways:

    1. Add a unique constraint for each invidivual Hull field in Vessel, i.e. MainHull, PortHull, StarboardHull. This will ensure that a Hull can only be used by one Vessel.
    2. Remove the Hull fields from vessel, and add a new field to Hull – Vessel. This then explicitly names the vessel that this hull belongs to. It would also seem to make sense to then add a HullType to Hull, so you know what type of hull it is. A unique constraint on HullType+Vessel will ensure that each vessel gets at most one hull of each type (but unfortunately, can have 0 of a given type.)

    I would go for the first one. since it seems more natural to select a vessel and then find the associated hulls, and also ensures that each vessel has the 3 hulls required (assmining a non-null constraint on MainHull, PortHull, StarboardHull.)

    EDIT: Seeing your comment, and given that vessels don’t need 3 hulls, then the second solution is also worth considering. If you need to add additional types of hull, you do this without changing your schema, since the hull type is not inferred from the field it is referenced, but named explicitly in the proposed ‘HullType’ field.

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

Sidebar

Ask A Question

Stats

  • Questions 406k
  • Answers 406k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you are seeking a single solution for all four… May 15, 2026 at 6:17 am
  • Editorial Team
    Editorial Team added an answer That code doesn't even compile. What is new Paint; for… May 15, 2026 at 6:17 am
  • Editorial Team
    Editorial Team added an answer From jQUeryUi TAB's documentation: Note that opening a tab in… May 15, 2026 at 6:17 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.