You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

126 lines
2.6 KiB

4 years ago
  1. import sys.db.Object;
  2. import sys.db.Types;
  3. @:keep class MySpodClass extends Object
  4. {
  5. public var theId:SId;
  6. public var int:SInt;
  7. public var double:SFloat;
  8. public var boolean:SBool;
  9. public var string:SString<255>;
  10. public var date:SDateTime;
  11. public var binary:SBinary;
  12. public var abstractType:AbstractSpodTest<String>;
  13. public var nullInt:SNull<Int>;
  14. public var enumFlags:SFlags<SpodEnum>;
  15. @:relation(rid) public var relation:OtherSpodClass;
  16. @:relation(rnid) public var relationNullable:Null<OtherSpodClass>;
  17. @:relation(spid) public var next:Null<MySpodClass>;
  18. public var data:SData<Array<ComplexClass>>;
  19. public var anEnum:SEnum<SpodEnum>;
  20. public var bytes:SBytes<2>;
  21. }
  22. @:keep class NullableSpodClass extends Object
  23. {
  24. public var theId:SId;
  25. @:relation(rnid) public var relationNullable:Null<OtherSpodClass>;
  26. public var data:Null<SData<Array<ComplexClass>>>;
  27. public var anEnum:Null<SEnum<SpodEnum>>;
  28. public var int:SNull<SInt>;
  29. public var double:SNull<SFloat>;
  30. public var boolean:SNull<SBool>;
  31. public var string:SNull<SString<255>>;
  32. public var date:SNull<SDateTime>;
  33. public var binary:SNull<SBinary>;
  34. public var abstractType:SNull<AbstractSpodTest<String>>;
  35. public var nullInt:SNull<Int>;
  36. public var enumFlags:SNull<SFlags<SpodEnum>>;
  37. }
  38. @:keep class ComplexClass
  39. {
  40. public var val : { name:String, array:Array<String> };
  41. public function new(val)
  42. {
  43. this.val = val;
  44. }
  45. }
  46. @:id(theid) @:keep class OtherSpodClass extends Object
  47. {
  48. public var theid:SInt;
  49. public var name:SString<255>;
  50. public function new(name:String)
  51. {
  52. super();
  53. this.name =name;
  54. }
  55. }
  56. @:keep enum SpodEnum
  57. {
  58. FirstValue;
  59. SecondValue;
  60. ThirdValue;
  61. }
  62. abstract AbstractSpodTest<A>(A) from A
  63. {
  64. public function get():A
  65. {
  66. return this;
  67. }
  68. }
  69. @:id(name)
  70. @:keep class ClassWithStringId extends Object
  71. {
  72. public var name:SString<255>;
  73. public var field:SInt;
  74. }
  75. @:keep class ClassWithStringIdRef extends Object
  76. {
  77. public var id:SId;
  78. @:relation(ref_id) public var ref:ClassWithStringId;
  79. }
  80. //issue #3828
  81. @:keep @:skip class BaseIssueC3828 extends sys.db.Object {
  82. public var id : SInt;
  83. @:relation(ruid)
  84. public var refUser : SNull<IssueC3828>;
  85. }
  86. @:keep class IssueC3828 extends BaseIssueC3828 {
  87. }
  88. @:keep class Issue6041Table extends Object {
  89. public var id:SInt = 0;
  90. }
  91. // issue #<to be numbered>
  92. class TLazyIssueFoo extends sys.db.Object {
  93. public var id:SId;
  94. @:relation(bid) public var bar:TLazyIssueBar;
  95. public function new(bar:TLazyIssueBar)
  96. {
  97. var lastFoo = TLazyIssueFoo.manager.select($bar == bar, { orderBy : -id, limit : 1 }, false);
  98. super();
  99. }
  100. }
  101. class TLazyIssueBar extends sys.db.Object {
  102. public var id:SId;
  103. public var initialized:SString<255> = "bar";
  104. }