First test project besides demo tutorial. New to MyEclipseide
Trying to create: Web Project, Scaffold Spring CRUD APP, Using Database Schema, Sql Server JTDS driver, Spring Web flow.
Wanted to test a parent table with several OneToOne FK relations. Will include DB Schema at bottom. It is a basic inventory table with many lookup tables. Like ActionType, BarrelType, etc..
Selected GunInventory as parent table and included other tables.
When the screen with the inventory table is loaded, it does not contain columns with keys to the onetoone tables. All other columns show. When I edit the table still only the columns that are not associated with the onetoone columns. None of the FK tables show with the onetoone to be updated with the parent GunInventory table. Interestingly though on the view screen again only the columns show that are not associated with FK table but the FKtables each have buttons at the bottom and when clicked on show with a edit/delete button at bottom. I would have expected them to be on the update screen.
Again this is my first project and any help would be appreciated and I tried to give enough info to get started.
USE [GunWorks]
GO
/****** Object: Schema [gun] Script Date: 01/11/2012 20:01:18 ******/
CREATE SCHEMA [gun] AUTHORIZATION [dbo]
GO
/****** Object: Table [gun].[FinishType] Script Date: 01/11/2012 20:01:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [gun].[FinishType](
[FinishTypeID] [int] IDENTITY(1,1) NOT NULL,
[FinishTypeDesc] [varchar](50) NOT NULL,
[rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_FinishType] PRIMARY KEY CLUSTERED
(
[FinishTypeID] 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 [gun].[Caliber] Script Date: 01/11/2012 20:01:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [gun].[Caliber](
[CaliberID] [int] IDENTITY(1,1) NOT NULL,
[CaliberDesc] [varchar](50) NOT NULL,
[rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_Caliber] PRIMARY KEY CLUSTERED
(
[CaliberID] 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 [gun].[BarrelType] Script Date: 01/11/2012 20:01:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [gun].[BarrelType](
[BarrelTypeID] [int] IDENTITY(1,1) NOT NULL,
[BarrelTypeDesc] [varchar](50) NOT NULL,
[rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_BarrelType] PRIMARY KEY CLUSTERED
(
[BarrelTypeID] 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 [gun].[ActionType] Script Date: 01/11/2012 20:01:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [gun].[ActionType](
[ActionTypeID] [int] IDENTITY(1,1) NOT NULL,
[ActionTypeDesc] [varchar](50) NOT NULL,
[rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_ActionType] PRIMARY KEY CLUSTERED
(
[ActionTypeID] 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 [gun].[Manufacturer] Script Date: 01/11/2012 20:01:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [gun].[Manufacturer](
[ManufacturerID] [int] IDENTITY(1,1) NOT NULL,
[ManufacturerDesc] [varchar](50) NOT NULL,
[rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_Manufacturer] PRIMARY KEY CLUSTERED
(
[ManufacturerID] 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 [gun].[GunStyle] Script Date: 01/11/2012 20:01:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [gun].[GunStyle](
[GunStyleID] [int] IDENTITY(1,1) NOT NULL,
[GunStyleDesc] [varchar](50) NOT NULL,
[rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_GunStyle] PRIMARY KEY CLUSTERED
(
[GunStyleID] 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 [gun].[GunInventory] Script Date: 01/11/2012 20:01:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [gun].[GunInventory](
[GunID] [int] IDENTITY(1,1) NOT NULL,
[ManufacturerID] [int] NOT NULL,
[Model] [varchar](50) NOT NULL,
[ModelNumber] [varchar](50) NOT NULL,
[ActionTypeID] [int] NOT NULL,
[CaliberID] [int] NOT NULL,
[FinishTypeID] [int] NOT NULL,
[BarrelTypeID] [int] NOT NULL,
[BarrelLength] [real] NOT NULL,
[GunStyleID] [int] NOT NULL,
[Accessories] [varchar](100) NOT NULL,
[DatePurchased] [date] NOT NULL,
[PurchasePrice] [money] NOT NULL,
[EstimatedValue] [money] NOT NULL,
[PurchasedFrom] [varchar](50) NULL,
[SerialNum] [varchar](25) NOT NULL,
[Notes] [nvarchar](250) NULL,
[rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_GunInventory] PRIMARY KEY CLUSTERED
(
[GunID] 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: Default [DF_ActionType_rowguid] Script Date: 01/11/2012 20:01:18 ******/
ALTER TABLE [gun].[ActionType] ADD CONSTRAINT [DF_ActionType_rowguid] DEFAULT (newid()) FOR [rowguid]
GO
/****** Object: Default [DF_ActionType_ModifiedDate] Script Date: 01/11/2012 20:01:18 ******/
ALTER TABLE [gun].[ActionType] ADD CONSTRAINT [DF_ActionType_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]
GO
/****** Object: Default [DF_BarrelType_rowguid] Script Date: 01/11/2012 20:01:18 ******/
ALTER TABLE [gun].[BarrelType] ADD CONSTRAINT [DF_BarrelType_rowguid] DEFAULT (newid()) FOR [rowguid]
GO
/****** Object: Default [DF_BarrelType_ModifiedDate] Script Date: 01/11/2012 20:01:18 ******/
ALTER TABLE [gun].[BarrelType] ADD CONSTRAINT [DF_BarrelType_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]
GO
/****** Object: Default [DF_Caliber_rowguid] Script Date: 01/11/2012 20:01:18 ******/
ALTER TABLE [gun].[Caliber] ADD CONSTRAINT [DF_Caliber_rowguid] DEFAULT (newid()) FOR [rowguid]
GO
/****** Object: Default [DF_Caliber_ModifiedDate] Script Date: 01/11/2012 20:01:18 ******/
ALTER TABLE [gun].[Caliber] ADD CONSTRAINT [DF_Caliber_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]
GO
/****** Object: Default [DF_FinishType_rowguid] Script Date: 01/11/2012 20:01:18 ******/
ALTER TABLE [gun].[FinishType] ADD CONSTRAINT [DF_FinishType_rowguid] DEFAULT (newid()) FOR [rowguid]
GO
/****** Object: Default [DF_FinishType_ModifiedDate] Script Date: 01/11/2012 20:01:18 ******/
ALTER TABLE [gun].[FinishType] ADD CONSTRAINT [DF_FinishType_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]
GO
/****** Object: Default [DF_GunInventory_rowguid] Script Date: 01/11/2012 20:01:18 ******/
ALTER TABLE [gun].[GunInventory] ADD CONSTRAINT [DF_GunInventory_rowguid] DEFAULT (newid()) FOR [rowguid]
GO
/****** Object: Default [DF_GunInventory_ModifiedDate] Script Date: 01/11/2012 20:01:18 ******/
ALTER TABLE [gun].[GunInventory] ADD CONSTRAINT [DF_GunInventory_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]
GO
/****** Object: Default [DF_GunStyle_rowguid] Script Date: 01/11/2012 20:01:18 ******/
ALTER TABLE [gun].[GunStyle] ADD CONSTRAINT [DF_GunStyle_rowguid] DEFAULT (newid()) FOR [rowguid]
GO
/****** Object: Default [DF_GunStyle_ModifiedDate] Script Date: 01/11/2012 20:01:18 ******/
ALTER TABLE [gun].[GunStyle] ADD CONSTRAINT [DF_GunStyle_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]
GO
/****** Object: Default [DF_Manufacturer_rowguid] Script Date: 01/11/2012 20:01:18 ******/
ALTER TABLE [gun].[Manufacturer] ADD CONSTRAINT [DF_Manufacturer_rowguid] DEFAULT (newid()) FOR [rowguid]
GO
/****** Object: Default [DF_Manufacturer_ModifiedDate] Script Date: 01/11/2012 20:01:18 ******/
ALTER TABLE [gun].[Manufacturer] ADD CONSTRAINT [DF_Manufacturer_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]
GO
/****** Object: ForeignKey [FK_GunInventory_ActionType] Script Date: 01/11/2012 20:01:18 ******/
ALTER TABLE [gun].[GunInventory] WITH CHECK ADD CONSTRAINT [FK_GunInventory_ActionType] FOREIGN KEY([ActionTypeID])
REFERENCES [gun].[ActionType] ([ActionTypeID])
GO
ALTER TABLE [gun].[GunInventory] CHECK CONSTRAINT [FK_GunInventory_ActionType]
GO
/****** Object: ForeignKey [FK_GunInventory_BarrelType] Script Date: 01/11/2012 20:01:18 ******/
ALTER TABLE [gun].[GunInventory] WITH CHECK ADD CONSTRAINT [FK_GunInventory_BarrelType] FOREIGN KEY([BarrelTypeID])
REFERENCES [gun].[BarrelType] ([BarrelTypeID])
GO
ALTER TABLE [gun].[GunInventory] CHECK CONSTRAINT [FK_GunInventory_BarrelType]
GO
/****** Object: ForeignKey [FK_GunInventory_Caliber] Script Date: 01/11/2012 20:01:18 ******/
ALTER TABLE [gun].[GunInventory] WITH CHECK ADD CONSTRAINT [FK_GunInventory_Caliber] FOREIGN KEY([CaliberID])
REFERENCES [gun].[Caliber] ([CaliberID])
GO
ALTER TABLE [gun].[GunInventory] CHECK CONSTRAINT [FK_GunInventory_Caliber]
GO
/****** Object: ForeignKey [FK_GunInventory_FinishType] Script Date: 01/11/2012 20:01:18 ******/
ALTER TABLE [gun].[GunInventory] WITH CHECK ADD CONSTRAINT [FK_GunInventory_FinishType] FOREIGN KEY([FinishTypeID])
REFERENCES [gun].[FinishType] ([FinishTypeID])
GO
ALTER TABLE [gun].[GunInventory] CHECK CONSTRAINT [FK_GunInventory_FinishType]
GO
/****** Object: ForeignKey [FK_GunInventory_GunStyle] Script Date: 01/11/2012 20:01:18 ******/
ALTER TABLE [gun].[GunInventory] WITH CHECK ADD CONSTRAINT [FK_GunInventory_GunStyle] FOREIGN KEY([GunStyleID])
REFERENCES [gun].[GunStyle] ([GunStyleID])
GO
ALTER TABLE [gun].[GunInventory] CHECK CONSTRAINT [FK_GunInventory_GunStyle]
GO
/****** Object: ForeignKey [FK_GunInventory_Manufacturer] Script Date: 01/11/2012 20:01:18 ******/
ALTER TABLE [gun].[GunInventory] WITH CHECK ADD CONSTRAINT [FK_GunInventory_Manufacturer] FOREIGN KEY([ManufacturerID])
REFERENCES [gun].[Manufacturer] ([ManufacturerID])
GO
ALTER TABLE [gun].[GunInventory] CHECK CONSTRAINT [FK_GunInventory_Manufacturer]
GO
Thanks, Mike |