diff options
author | James Moger <james.moger@gmail.com> | 2012-09-25 18:05:13 -0400 |
---|---|---|
committer | James Moger <james.moger@gmail.com> | 2012-09-25 18:05:13 -0400 |
commit | c42ebc94e34b3a1aa27c292188e73f5b06af814a (patch) | |
tree | 5dbb4e5e261e13a0563e64a995042f1d7cd2479e /tests/com/iciql/test/models | |
parent | b4d82730f640969ed92de915134ef28821d225ed (diff) | |
download | iciql-c42ebc94e34b3a1aa27c292188e73f5b06af814a.tar.gz iciql-c42ebc94e34b3a1aa27c292188e73f5b06af814a.zip |
Support for read-only views (issue 8)
Diffstat (limited to 'tests/com/iciql/test/models')
4 files changed, 161 insertions, 0 deletions
diff --git a/tests/com/iciql/test/models/ProductView.java b/tests/com/iciql/test/models/ProductView.java new file mode 100644 index 0000000..2efe9eb --- /dev/null +++ b/tests/com/iciql/test/models/ProductView.java @@ -0,0 +1,47 @@ +/* + * Copyright 2012 James Moger. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.iciql.test.models; + +import com.iciql.Iciql.IQColumn; +import com.iciql.Iciql.IQConstraint; +import com.iciql.Iciql.IQView; + +/** + * A view containing product data. + */ + +@IQView(name = "AnnotatedProductView", tableName = "AnnotatedProduct") +public class ProductView { + + public String unmappedField; + + @IQColumn(name = "id", autoIncrement = true) + @IQConstraint("this <= 7 AND this > 2") + public Long productId; + + @IQColumn(name = "name") + public String productName; + + public ProductView() { + // public constructor + } + + public String toString() { + return productName + " (" + productId + ")"; + } + +} diff --git a/tests/com/iciql/test/models/ProductViewFromQuery.java b/tests/com/iciql/test/models/ProductViewFromQuery.java new file mode 100644 index 0000000..2f2f194 --- /dev/null +++ b/tests/com/iciql/test/models/ProductViewFromQuery.java @@ -0,0 +1,42 @@ +/* + * Copyright 2012 James Moger. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.iciql.test.models; + +import com.iciql.Iciql.IQColumn; +import com.iciql.Iciql.IQView; + +/** + * A view containing product data. + */ + +@IQView(name = "AnnotatedProductViewInherited", inheritColumns = true) +public class ProductViewFromQuery extends ProductAnnotationOnly { + + public String unmappedField; + + @IQColumn(name = "id") + public Long productId; + + public ProductViewFromQuery() { + // public constructor + } + + public String toString() { + return productName + " (" + productId + ")"; + } + +} diff --git a/tests/com/iciql/test/models/ProductViewInherited.java b/tests/com/iciql/test/models/ProductViewInherited.java new file mode 100644 index 0000000..e9c274b --- /dev/null +++ b/tests/com/iciql/test/models/ProductViewInherited.java @@ -0,0 +1,44 @@ +/* + * Copyright 2012 James Moger. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.iciql.test.models; + +import com.iciql.Iciql.IQColumn; +import com.iciql.Iciql.IQConstraint; +import com.iciql.Iciql.IQView; + +/** + * A view containing product data. + */ + +@IQView(name = "AnnotatedProductViewInherited", inheritColumns = true) +public class ProductViewInherited extends ProductAnnotationOnly { + + public String unmappedField; + + @IQColumn(name = "id", autoIncrement = true) + @IQConstraint("this <= 7 AND this > 2") + public Long productId; + + public ProductViewInherited() { + // public constructor + } + + public String toString() { + return productName + " (" + productId + ")"; + } + +} diff --git a/tests/com/iciql/test/models/ProductViewInheritedComplex.java b/tests/com/iciql/test/models/ProductViewInheritedComplex.java new file mode 100644 index 0000000..55e7ba8 --- /dev/null +++ b/tests/com/iciql/test/models/ProductViewInheritedComplex.java @@ -0,0 +1,28 @@ +/* + * Copyright 2012 James Moger. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.iciql.test.models; + +import com.iciql.Iciql.IQView; + +/** + * A view containing product data. + */ + +@IQView(inheritColumns = true) +public class ProductViewInheritedComplex extends ProductViewInherited { + +} |