Incorrect syntax near '-'.
This tells me that you've named a database, table or column with a dash in it, not that POJO is having an issue mapping your columns.
As an example, if you've named your entity bar-none
and POJO issues the following CREATE TABLE
statement:
CREATE TABLE dbo.foo(bar-none BIT);
Or this one:
CREATE TABLE dbo.foo-bar(none BIT);
You will get this error:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '-'.
And in fact even if you declare a data type that does not exist in SQL Server, such as Boolean
, Frank
or WhatTheHeckDataTypeIsThis
, the parser will still barf with the above error due to the hyphen, before it even bothers validating the data type(s).
So, please check your table name and column names and be sure that your names don't use dashes, spaces or other special characters, that they aren't reserved words, and that each name you provide obeys the well-documented rules for identifiers. While you can get around this error if you can coerce POJO to properly delimit bad names with [square brackets]
, this is not a best practice.