Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Suggested Answer
Replies
22 replies
Answers
1 answer
Subscribers
7 subscribers
Views
16163 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
How to specify the uniqueidentifier datatype of SQL SERVER in XSD type?...
bharathwajanr587
over 10 years ago
How to specify the uniqueidentifier datatype of SQL SERVER in XSD type?...
OriginalPostID-104088
OriginalPostID-104088
Discussion posts and replies are publicly visible
0
Eduardo Fuentes
Appian Employee
over 10 years ago
These annotations will map to a primary key in SQL Server that is of type auto-increment if that is what you need
@Id
@GeneratedValue
Example:
<xsd:element name="id" type="xsd:int">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">
@Id
@GeneratedValue
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
bharathwajanr587
over 10 years ago
I was trying to map the existing table structure in the SQLSERVER which has a field having the type "uniqueidentifier" to the XSD structure. Does the XSD has the type called "uniqueIdentifiier"? if not, how can we map that field to the existing table?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 10 years ago
There's no JPA annotation for this type of column. The following syntax is only compatible at the Hibernate level but not at the JPA level
@GenericGenerator(name = "generator" strategy = "guid")
@GeneratedValue(generator = "generator")
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
dylanf
over 10 years ago
Did this end up working for you? Most of our tables have at lease one uniqueidentifier item in them.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
vinitl522
A Score Level 2
over 9 years ago
I am also looking to map existing table to a cdt which has many unique identifier, any solution for this?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 9 years ago
You may want to try something like this:
@Id
@GenericGenerator(name = "generator", strategy = "guid", parameters = {})
@GeneratedValue(generator = "generator")
@Column(name = "APPLICATION_ID" , columnDefinition="uniqueidentifier")
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
vinitl522
A Score Level 2
over 9 years ago
hello eduardo, when trying to use above annotation, and trying to import the cdt, get the below error:
A type mapping annotation is invalid: Found Array End (}) but expected one of : Annotation, Value (e.g. String, int), Attribute Name. @Id @GenericGenerator(name = "generator", strategy = "guid", parameters = {}_) @GeneratedValue(generator = "generator") @Column(name = "prospect_name", columnDefinition="uniqueidentifier") Current lexeme: } (APNX-2-4055-000)
Below is the column, that i am trying to map a column:
<xsd:element name="prospectName" nillable="true" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">
@Id
@GenericGenerator(name = "generator", strategy = "guid", parameters = {})
@GeneratedValue(generator = "generator")
@Column(name = "prospect_name", columnDefinition="uniqueidentifier")
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 9 years ago
@Id
Try this instead:
@GenericGenerator(name = "generator", strategy = "guid")
@GeneratedValue(generator = "generator")
@Column(name = "APPLICATION_ID" , columnDefinition="uniqueidentifier")
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 9 years ago
@Id
@GenericGenerator(name = "generator", strategy = "guid")
@GeneratedValue(generator = "generator")
@Column(name = "APPLICATION_ID" , columnDefinition="uniqueidentifier")
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 9 years ago
For your example it would be:
@Id
@GenericGenerator(name = "generator" strategy = "guid")
@GeneratedValue(generator = "generator")
@Column(name = "prospect_name" columnDefinition="uniqueidentifier")
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>