Advertisement
Guest User

Untitled

a guest
Jul 14th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.34 KB | None | 0 0
  1. Player[
  2. id=1,
  3. _id=531029b207987409620000d6,
  4. battingStyle=RHB,
  5. bowlingStyle=RAOS,
  6. dob=2000-02-28T06: 15: 15.264Z,
  7. playingRole=BWL,
  8. sname=QadeerButt,
  9. fname=Tahir,
  10. gallery=[
  11.  
  12. ],
  13. games=[
  14. Game[
  15. id=4,
  16. gameType=T20‎,
  17. name=TotallyCricketvsLahoreTiger,
  18. totalOvers=20,
  19. dateStarted=2014-06-18T19: 00: 00.000Z,
  20. dateEnded=2014-06-18T19: 00: 00.000Z,
  21. innings=[
  22.  
  23. ],
  24. grounds=[
  25. Ground[
  26. id=26,
  27. address=14835SE18thPl,
  28. Bellevue,
  29. WA98007,
  30. UnitedStates,
  31. city=Bellevue,
  32. country=UnitedStates,
  33. name=RobinswoodPark
  34. ],
  35. Ground[
  36. id=26,
  37. address=14835SE18thPl,
  38. Bellevue,
  39. WA98007,
  40. UnitedStates,
  41. city=Bellevue,
  42. country=UnitedStates,
  43. name=RobinswoodPark
  44. ]
  45. ],
  46. teams=[
  47. Team[
  48. id=30,
  49. name=TotallyCricket,
  50. category=Veterans,
  51. teamGender=Men,
  52. rating=5
  53. ],
  54. Team[
  55. id=19,
  56. name=LahoreTiger,
  57. category=Under19,
  58. teamGender=Men,
  59. rating=3
  60. ]
  61. ]
  62. ]
  63. ]
  64. ]
  65. And player model class are
  66. package com.tt.models;
  67. import java.util.Collection;
  68. import com.google.gson.annotations.SerializedName;
  69. import com.j256.ormlite.field.DatabaseField;
  70. import com.j256.ormlite.field.ForeignCollectionField;
  71. import com.j256.ormlite.table.DatabaseTable;
  72.  
  73. @DatabaseTable(tableName = "Player")
  74. public class Player {
  75. public static final String BATTING_ID_FIELD_NAME = "batting_id";
  76. public static final String BOWLING_ID_FIELD_NAME = "bowling_id";
  77. public static final String TEAM_ID_FIELD_NAME = "team_id";
  78. @SerializedName("__v")
  79. @DatabaseField(id = true)
  80. private int id;
  81.  
  82. @SerializedName("_id")
  83. @DatabaseField(columnName = "_id")
  84. private String _id;
  85. /*@SerializedName("__v")
  86. @DatabaseField(columnName = "__v",id=true)
  87. private int __v;*/
  88. @DatabaseField
  89. private String battingStyle;
  90. @DatabaseField
  91. private String bowlingStyle;
  92. @DatabaseField
  93. private String dob;
  94. @DatabaseField
  95. private String playingRole;
  96. @DatabaseField
  97. private String sname;
  98. @DatabaseField
  99. private String fname;
  100. @SerializedName("gallery")
  101. @ForeignCollectionField(eager = true, maxEagerLevel = 2)
  102. private Collection<Gallery> gallery;
  103.  
  104. @SerializedName("games")
  105. @ForeignCollectionField(eager = true)
  106. private Collection<Game> games;
  107.  
  108. /*
  109. * @DatabaseField(dataType = DataType.SERIALIZABLE) private String[] users;
  110. */
  111. /*
  112. * @DatabaseField(dataType = DataType.SERIALIZABLE) private String[] squad;
  113. */
  114.  
  115. Player() {
  116.  
  117. }
  118.  
  119. public int getId() {
  120. return id;
  121. }
  122.  
  123. public void setId(int id) {
  124. this.id = id;
  125. }
  126.  
  127.  
  128. public String getBattingStyle() {
  129. return battingStyle;
  130. }
  131.  
  132. public void setBattingStyle(String battingStyle) {
  133. this.battingStyle = battingStyle;
  134. }
  135.  
  136. public String getBowlingStyle() {
  137. return bowlingStyle;
  138. }
  139.  
  140. public void setBowlingStyle(String bowlingStyle) {
  141. this.bowlingStyle = bowlingStyle;
  142. }
  143.  
  144. public String getDob() {
  145. return dob;
  146. }
  147.  
  148. public void setDob(String dob) {
  149. this.dob = dob;
  150. }
  151.  
  152. public String getPlayingRole() {
  153. return playingRole;
  154. }
  155.  
  156. public void setPlayingRole(String playingRole) {
  157. this.playingRole = playingRole;
  158. }
  159.  
  160. public String getSname() {
  161. return sname;
  162. }
  163.  
  164. public void setSname(String sname) {
  165. this.sname = sname;
  166. }
  167.  
  168. public String getFname() {
  169. return fname;
  170. }
  171.  
  172. public void setFname(String fname) {
  173. this.fname = fname;
  174. }
  175.  
  176. /*
  177. * public String[] getUsers() { return users; }
  178. *
  179. * public void setUsers(String[] users) { this.users = users; }
  180. */
  181.  
  182. /*
  183. * public String[] getSquad() { return squad; }
  184. *
  185. * public void setSquad(String[] squad) { this.squad = squad; }
  186. */
  187.  
  188. public Collection<Gallery> getGallerys() {
  189. return gallery;
  190. }
  191.  
  192. public void setGallerys(Collection<Gallery> gallery) {
  193. this.gallery = gallery;
  194. }
  195.  
  196. public Collection<Gallery> getGallery() {
  197. return gallery;
  198. }
  199.  
  200. public void setGallery(Collection<Gallery> gallery) {
  201. this.gallery = gallery;
  202. }
  203.  
  204. public Collection<Game> getGames() {
  205. return games;
  206. }
  207.  
  208. public void setGames(Collection<Game> games) {
  209. this.games = games;
  210. }
  211.  
  212. public String get_id() {
  213. return _id;
  214. }
  215.  
  216. public void set_id(String _id) {
  217. this._id = _id;
  218. }
  219.  
  220. @Override
  221. public String toString() {
  222. return "Player [id=" + id + ", _id=" + _id + ", battingStyle="
  223. + battingStyle + ", bowlingStyle=" + bowlingStyle + ", dob="
  224. + dob + ", playingRole=" + playingRole + ", sname=" + sname
  225. + ", fname=" + fname + ", gallery=" + gallery + ", games="
  226. + games + "]";
  227. }
  228.  
  229.  
  230. }
  231. And Game model class
  232. package com.tt.models;
  233.  
  234. import java.util.Collection;
  235.  
  236. import com.google.gson.annotations.SerializedName;
  237. import com.j256.ormlite.field.DatabaseField;
  238. import com.j256.ormlite.field.ForeignCollectionField;
  239. import com.j256.ormlite.table.DatabaseTable;
  240.  
  241. @DatabaseTable(tableName = "Game")
  242. public class Game {
  243. public static final String INNING_ID_FIELD_NAME = "inning_id";
  244. public static final String PLAYER_ID_FIELD_NAME = "player_id";
  245. @SerializedName("__v")
  246. @DatabaseField(id = true)
  247. private int id;
  248.  
  249. /*
  250. * @SerializedName("_id")
  251. *
  252. * @DatabaseField(columnName = "_id") private String _id;
  253. *
  254. * @SerializedName("__v")
  255. *
  256. * @DatabaseField(columnName = "__v",id=true) private int __v;
  257. */
  258. @SerializedName("gameType")
  259. @DatabaseField
  260. private String gameType;
  261. @SerializedName("name")
  262. @DatabaseField
  263. private String name;
  264. @SerializedName("totalOvers")
  265. @DatabaseField
  266. private String totalOvers;
  267. @SerializedName("dateStarted")
  268. @DatabaseField
  269. private String dateStarted;
  270. @SerializedName("dateEnded")
  271. @DatabaseField
  272. private String dateEnded;
  273. @SerializedName("innings")
  274. @ForeignCollectionField(eager = true, maxEagerLevel = 2)
  275. private Collection<Inning> innings;
  276. @DatabaseField(foreign = true, foreignAutoCreate = true, foreignAutoRefresh = true, columnName = PLAYER_ID_FIELD_NAME)
  277. private transient Player player;
  278. @SerializedName("grounds")
  279. @ForeignCollectionField(eager = true, maxEagerLevel = 2)
  280. private Collection<Ground> grounds;
  281. @SerializedName("teams")
  282. @ForeignCollectionField(eager = true, maxEagerLevel = 2)
  283. private Collection<Team> teams;
  284.  
  285. public Game() {
  286. // all persisted classes must define a no-arg constructor with at least
  287. // package visibility
  288. }
  289.  
  290. /*
  291. * public String get_id() { return _id; }
  292. *
  293. * public void set_id(String _id) { this._id = _id; }
  294. */
  295.  
  296. public String getGameType() {
  297. return gameType;
  298. }
  299.  
  300. public int getId() {
  301. return id;
  302. }
  303.  
  304. public void setId(int id) {
  305. this.id = id;
  306. }
  307.  
  308. public void setGameType(String gameType) {
  309. this.gameType = gameType;
  310. }
  311.  
  312. public Collection<Ground> getGrounds() {
  313. return grounds;
  314. }
  315.  
  316. public void setGrounds(Collection<Ground> grounds) {
  317. this.grounds = grounds;
  318. }
  319.  
  320. public String getName() {
  321. return name;
  322. }
  323.  
  324. public void setName(String name) {
  325. this.name = name;
  326. }
  327.  
  328. public String getDateStarted() {
  329. return dateStarted;
  330. }
  331.  
  332. public void setDateStarted(String dateStarted) {
  333. this.dateStarted = dateStarted;
  334. }
  335.  
  336. public String getDateEnded() {
  337. return dateEnded;
  338. }
  339.  
  340. public void setDateEnded(String dateEnded) {
  341. this.dateEnded = dateEnded;
  342. }
  343.  
  344. public String getTotalOvers() {
  345. return totalOvers;
  346. }
  347.  
  348. public void setTotalOvers(String totalOvers) {
  349. this.totalOvers = totalOvers;
  350. }
  351.  
  352. public Player getPlayer() {
  353. return player;
  354. }
  355.  
  356. public void setPlayer(Player player) {
  357. this.player = player;
  358. }
  359.  
  360. public Collection<Inning> getInnings() {
  361. return innings;
  362. }
  363.  
  364. public void setInnings(Collection<Inning> innings) {
  365. this.innings = innings;
  366. }
  367.  
  368. public Collection<Team> getTeams() {
  369. return teams;
  370. }
  371.  
  372. public void setTeams(Collection<Team> teams) {
  373. this.teams = teams;
  374. }
  375.  
  376. @Override
  377. public String toString() {
  378. return "Game [id=" + id + ", gameType=" + gameType + ", name=" + name
  379. + ", totalOvers=" + totalOvers + ", dateStarted=" + dateStarted
  380. + ", dateEnded=" + dateEnded + ", innings=" + innings
  381. + ", grounds=" + grounds + ", teams=" + teams + "]";
  382. }
  383.  
  384. }
  385.  
  386. And ground model
  387. package com.tt.models;
  388.  
  389. import android.widget.Toast;
  390.  
  391. import com.google.gson.annotations.SerializedName;
  392. import com.j256.ormlite.field.DatabaseField;
  393. import com.j256.ormlite.table.DatabaseTable;
  394. import com.tt.Utilities.Utils;
  395.  
  396. @DatabaseTable(tableName = "Ground")
  397. public class Ground {
  398. public static final String GAME_ID_FIELD_NAME = "game_id";
  399.  
  400. @SerializedName("__v")
  401. @DatabaseField(id = true)
  402. private int id;
  403.  
  404. /*
  405. * @SerializedName("_id")
  406. *
  407. * @DatabaseField(columnName = "_id",unique=true) private String _id;
  408. *
  409. * @SerializedName("__v")
  410. *
  411. * @DatabaseField(columnName = "__v",id=true) private int __v;
  412. */
  413. @SerializedName("address")
  414. @DatabaseField
  415. private String address;
  416. @SerializedName("city")
  417. @DatabaseField
  418. private String city;
  419. @SerializedName("country")
  420. @DatabaseField
  421. private String country;
  422. @SerializedName("name")
  423. @DatabaseField
  424. private String name;
  425. @DatabaseField(foreign = true, foreignAutoCreate = true, foreignAutoRefresh = true, maxForeignAutoRefreshLevel = 3, columnName = GAME_ID_FIELD_NAME)
  426. private transient Game game;
  427.  
  428. public Ground() {
  429. // all persisted classes must define a no-arg constructor with at least
  430. // package visibility
  431. }
  432.  
  433. public int getId() {
  434. return id;
  435. }
  436.  
  437. public void setId(int id) {
  438. this.id = id;
  439. }
  440.  
  441. public String getGameType() {
  442. return address;
  443. }
  444.  
  445. public void setGameType(String gameType) {
  446. this.address = gameType;
  447. }
  448.  
  449. public Game getGame() {
  450. return game;
  451. }
  452.  
  453. public void setGame(Game game) {
  454. this.game = game;
  455. }
  456.  
  457. public String getAddress() {
  458. return address;
  459. }
  460.  
  461. public void setAddress(String address) {
  462. this.address = address;
  463. }
  464.  
  465. public String getCity() {
  466. return city;
  467. }
  468.  
  469. public void setCity(String city) {
  470. this.city = city;
  471. }
  472.  
  473. public String getCountry() {
  474. return country;
  475. }
  476.  
  477. public void setCountry(String country) {
  478. this.country = country;
  479. }
  480.  
  481. public String getName() {
  482. return name;
  483. }
  484.  
  485. public void setName(String name) {
  486. this.name = name;
  487. }
  488.  
  489. @Override
  490. public String toString() {
  491. return "Ground [id=" + id + ", address=" + address + ", city=" + city
  492. + ", country=" + country + ", name=" + name + "]";
  493. }
  494.  
  495. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement