       foreign_key: :link_component_id,
       references: :component_id
 
+    # Specializations (included just to allow preparing them)
+    has_one :cpu, CPU,
+      foreign_key: :cpu_id,
+      references: :component_id
+    has_one :hdd, HDD,
+      foreign_key: :hdd_id,
+      references: :component_id
+    has_one :nic, NIC,
+      foreign_key: :nic_id,
+      references: :component_id
+    has_one :ram, RAM,
+      foreign_key: :ram_id,
+      references: :component_id
+
     timestamps()
+  end
+
+  @spec create_from_spec(ComponentSpec.t) :: Ecto.Changeset.t
+  def create_from_spec(cs = %ComponentSpec{}) do
+    params = %{component_type: cs.component_type, spec_id: cs.spec_id}
+
+    params
+    |> create_changeset()
+    |> prepare_from_spec(cs.spec)
   end
 
   @spec create_changeset(creation_params) :: Ecto.Changeset.t

    end
  end

  defmodule Query do

    alias Helix.Hardware.Model.Component

  use Ecto.Schema

  alias HELL.PK
  alias Helix.Hardware.Model.Component.CPU
  alias Helix.Hardware.Model.Component.HDD
  alias Helix.Hardware.Model.Component.NIC
  alias Helix.Hardware.Model.Component.RAM
  alias Helix.Hardware.Model.ComponentSpec
  alias Helix.Hardware.Model.MotherboardSlot

