Back to project page ormada.
The source code is released under:
Copyright (c) 2012 Jesse Rosalia 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 Sof...
If you think the Android project ormada listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.ormada.hsql.example.model; /*from w w w. j a va2s . com*/ import java.util.ArrayList; import java.util.List; import org.ormada.annotations.OneToMany; import org.ormada.annotations.Text; import org.ormada.annotations.Transient; public class Cat { private long id; private String name; private Cat otherCat; private List<Kitten> kittens = new ArrayList<Kitten>(); public long getId() { return id; } public void setId(long id) { this.id = id; } @Text public String getName() { return name; } public void setName(String name) { this.name = name; } public Cat getOtherCat() { return otherCat; } public void setOtherCat(Cat otherCat) { this.otherCat = otherCat; } @OneToMany(Kitten.class) public List<Kitten> getKittens() { return kittens; } public void setKittens(List<Kitten> kittens) { this.kittens = kittens; } @Transient public String getFamily() { StringBuilder builder = new StringBuilder(); builder.append(this.name); if (kittens != null) { for (Kitten kitten : kittens) { builder.append(", ").append(kitten.getName()); } } if (otherCat != null) { builder.append("\n\t").append(otherCat.getFamily()); } return builder.toString(); } }