Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 29th, 2014, 05: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.
Reply With Quote
  #2 (permalink)  
Old December 30th, 2014, 02: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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off



All times are GMT -4. The time now is 02:01 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.