Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Enterprise Android: Programming Android Database Applications for the Enterprise
This is the forum to discuss the Wrox book Enterprise Android: Programming Android Database Applications for the Enterprise by Zigurd Mednieks, G. Blake Meike, Laird Dornin, Zane Pan; ISBN: 978-1-118-18349-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Enterprise Android: Programming Android Database Applications for the Enterprise section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old December 29th, 2014, 06:51 PM
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.
  #2 (permalink)  
Old December 30th, 2014, 03:01 AM
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

I have the service running. It turns out the two problems do not stop the service from working.

Problem 1 is irrelevant because the Hibernate schema is not used, but fix it by deleting the @GeneratedValue line.

Problem 2 is fixed in the trivial way: simply rename the table on which the indexes are being created to contact_sync instead of the non-existent contact.






Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.