sai-pullabhotla / catatumbo

JPA like Persistence Framework for Google Cloud Datastore and Cloud Firestore
http://catatumbo.io
Apache License 2.0
51 stars 20 forks source link

Entity life cycle listener tutorial / example documentation #215

Closed Jboonie closed 5 years ago

Jboonie commented 5 years ago

@sai-pullabhotla This is an awesome framework. I have been trying to determine if the framework has event listeners and from reading through the project description it clearly does here. I have read through the API documentation but I'm a newbie and I'm still not 100% clear on how to actually implement a listener via Catatumbo. I searched through the website and the documentation on GitHub as well as plain old google searches and couldn't find any tutorials or examples. Would it be possible to add an example to your website or wiki that shows the basics of how these listeners are utilized? That would be super helpful! Keep up the great work!

sai-pullabhotla commented 5 years ago

@Jboonie - Thanks! I would recommend taking a look at some of the JUnit tests around Entity Listeners. That should give you a good idea on how to implement listeners. Here are some tests...

https://github.com/sai-pullabhotla/catatumbo/blob/master/src/test/java/com/jmethods/catatumbo/ExternalListenerTest.java

https://github.com/sai-pullabhotla/catatumbo/blob/master/src/test/java/com/jmethods/catatumbo/DefaultListenerTest.java

https://github.com/sai-pullabhotla/catatumbo/blob/master/src/test/java/com/jmethods/catatumbo/DefaultAndExternalListenersTest.java

https://github.com/sai-pullabhotla/catatumbo/blob/master/src/test/java/com/jmethods/catatumbo/ExcludeDefaultListenerTest.java

https://github.com/sai-pullabhotla/catatumbo/blob/master/src/test/java/com/jmethods/catatumbo/InternalListenerTest.java