View Single Post
  #1 (permalink)  
Old December 29th, 2014, 06:51 PM
tgkell tgkell is offline
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2014
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default springSyncServiceContacts

I'm trying to deploy the springSyncServiceContacts code, and the ant builddb step claims to succeed, but the SQL statements actually fail to execute.

I've traced this to two problems listed below. I believe I downloaded the code from this site, but it seems this code could never have worked, so I'll try getting a version directly from the git repository. In the meantime, if anyone has actually run this REST service, I'd be interested in knowing what exact code you used.

Problem 1:
The file src/com/enterpriseandroid/springServiceContacts/dataModel/Contact.java
has a @GeneratedValue annotation on a String data type:
Code:
        @Id
        @GeneratedValue(strategy=GenerationType.AUTO)
        private String id;
This problem causes Hibernate to generate invalid SQL DDL.

Problem 2:
The file contact.jdbc.sql creates a table called contact_sync but then attempts to create two indexes on a non-existent contact table:

Code:
CREATE TABLE contact_sync
(
id varchar(50) NOT NULL,
firstName varchar(255) NOT NULL,
lastName varchar(255) NOT NULL,
phone varchar(255),
email varchar(255),
deleted boolean,
updateTime bigint(20) NOT NULL,
version bigint(20) NOT NULL,
PRIMARY KEY (id)
);

create index updateTimeIndex on contact (updateTime);
create index firstNameIndex on contact (firstName);
The first problem seems nontrivial to fix, but the second one may be trivial. If I push through and get this REST service running, I'll post my patches.
Reply With Quote