Permalink
Browse files

Added readme and license

  • Loading branch information...
1 parent f9b39ca commit 7d82a9e75639f31be77d38911d6ce0c77d7b3b7d Jonathan Leibiusky committed Oct 6, 2010
Showing with 137 additions and 0 deletions.
  1. +22 −0 LICENSE.txt
  2. +115 −0 README.md
View
@@ -0,0 +1,22 @@
+Copyright (c) 2010 Gaurav Sharma and Jonathan Leibiusky
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
View
115 README.md
@@ -0,0 +1,115 @@
+# JOhm
+
+JOhm is a Object-hash mapping library for Java inspired on the awesome [Ohm](http://github.com/soveran/ohm).
+
+JOhm is a library for storing objects in Redis, a persistent key-value database.
+
+## What can I do with JOhm?
+Right now it is still in development. So just the following features are available.
+
+- Basic attribute persistance (String, Integer, etc...)
+- Auto-numeric Ids
+- Simple References
+- Indexes
+- Simple finders (on just one attribute)
+- Deletion
+- List relationship
+
+Stay close! It is growing pretty fast!
+
+## How do I use it?
+
+You can download the latests build at:
+ http://github.com/xetorthio/johm/downloads
+
+And this is a small example (getters and setters are not included for the sake of simplicity):
+
+ class User extends Model {
+ @Attribute
+ private String name;
+ @Attribute
+ @Indexed
+ private int age;
+ @Reference
+ private Country country;
+ @CollectionList(of = Comment.class)
+ private List<Comment> comments;
+ }
+
+ class Comment extends Model {
+ @Attribute
+ private String text;
+ }
+
+Creating a User and persisting it:
+
+ User someOne = new User();
+ someOne.setName("Someone");
+ someOne.setAge(30);
+ someOne.save();
+
+Loading a persisted User:
+
+ User storedUser = JOhm.get(User.class, 1);
+
+Deleting a User:
+
+ JOhm.delete(User.class, 1);
+
+Search for all users of age 30:
+
+ List<User> users = JOhm.find(User.class, "age", "30");
+
+Model with a reference:
+
+ User someOne = new User();
+ ...
+ someOne.save();
+
+ Country someCountry = new Country();
+ ...
+ country.save();
+
+ someOne.setCountry(someCountry);
+
+Model with a list of nested models:
+
+ User someOne = new User();
+ ...
+ someOne.save();
+
+ Comment aComment = new Comment();
+ ...
+ aComment.save();
+
+ someOne.getComments.add(aComment);
+
+For more usage examples check the tests. Soon I will add a nice wiki with everything you should know.
+
+And you are done!
+
+## License
+
+Copyright (c) 2010 Gaurav Sharma and Jonathan Leibiusky
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+

0 comments on commit 7d82a9e

Please sign in to comment.