On Thu, Nov 7, 2013 at 1:55 PM, Apostolos Emmanouilidis <aemmanou@redhat.com> wrote:
+1 ID generation by hand provides more flexibility.

btw the same result could be achieved by using uuid2 generator instead of uuid which is currently used and org.hibernate.id.uuid.StandardRandomStrategy. This way the UUID values are produced using java.util.UUID randomUUID. but I agree that removing odd annotations is a good idea

that is not portable to other JPA implementations, right ?

 


On Thu, 2013-11-07 at 12:38 +0100, Matthias Wessendorf wrote:
Hello, 



today the PushApplicationID ([1]) and VariantID (iOS example: [2]) are generated w/in the RESTful endpoint class. I'd like to move that into the actual entity - similar to what we today already do with the (master)secret (e.g. [3] or [4]).


Thoughts?




While on it - I'd like to do similar to the PK all ALL entities... Today we have an (odd) Hibernate dependency (see [5]), simple b/c of JPA being lame and not providing "propper" UUID support....  So idea is to
* remove the odd annotation
* do the ID generation "by hand" (like we do on the secret (see above...))


Thoughts?



Sure, this (both items of this mail) might lead to some more re-usable code (and better tests)




-Matthias




[1] https://github.com/aerogear/aerogear-unifiedpush-server/blob/master/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/PushApplicationEndpoint.java#L76
[2] https://github.com/aerogear/aerogear-unifiedpush-server/blob/master/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/iOSVariantEndpoint.java#L105
[3] https://github.com/aerogear/aerogear-unifiedpush-server/blob/master/src/main/java/org/jboss/aerogear/unifiedpush/model/PushApplication.java#L38
[4] https://github.com/aerogear/aerogear-unifiedpush-server/blob/master/src/main/java/org/jboss/aerogear/unifiedpush/model/AbstractVariant.java#L49
[5] https://github.com/aerogear/aerogear-unifiedpush-server/blob/master/src/main/java/org/jboss/aerogear/unifiedpush/jpa/PersistentObject.java#L34


--
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf
_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf