Commit d550543e authored by guozhipeng's avatar guozhipeng

Initial commit

parents
{
"sql": {
"native_hana_associations" : false
}
}
**/gen/
**/edmx/
*.db
*.sqlite
*.sqlite-wal
*.sqlite-shm
schema*.sql
default-env.json
**/bin/
**/target/
.flattened-pom.xml
.classpath
.project
.settings
**/node/
**/node_modules/
**/.mta/
*.mtar
*.log*
gc_history*
hs_err*
*.tgz
*.iml
.vscode
.idea
.reloadtrigger
ID;firstname;lastname
6061f01b-7fa6-43c3-a6d7-12adb9d25198;Emily;Brontë
2db38772-235e-432c-92a0-ce09ca340728;Charlotte;Brontë
286ae4b1-b845-4af8-9827-4eb04fe5f380;Edgar Allen;Poe
cbfec09e-0ff4-4cfc-adf1-0a37500da750;Richard;Carpenter
ID;parent_ID;name
1;;Poetry
2;;Biography
3;;Fantasy
4;;Science Fiction
5;;Romance
6;;Mystery
7;;Thriller
8;;Dystopia
9;;Tragedy
10;;Novel
ID;title;descr;author_ID;stock;price;currency_code;category_ID;createdAt
abed2f7a-c50e-4bc5-89fd-9a00a54b4b16;Wuthering Heights;"Wuthering Heights, Emily Brontë's only novel, was published in 1847 under the pseudonym ""Ellis Bell"". It was written between October 1845 and June 1846. Wuthering Heights and Anne Brontë's Agnes Grey were accepted by publisher Thomas Newby before the success of their sister Charlotte's novel Jane Eyre. After Emily's death, Charlotte edited the manuscript of Wuthering Heights and arranged for the edited version to be published as a posthumous second edition in 1850.";6061f01b-7fa6-43c3-a6d7-12adb9d25198;12;11.11;GBP;9;2019-09-20 10:10:10.000
6869961b-c533-42b7-9d60-30fae4f46ab6;Jane Eyre;"Jane Eyre /ɛər/ (originally published as Jane Eyre: An Autobiography) is a novel by English writer Charlotte Brontë, published under the pen name ""Currer Bell"", on 16 October 1847, by Smith, Elder & Co. of London. The first American edition was published the following year by Harper & Brothers of New York. Primarily a bildungsroman, Jane Eyre follows the experiences of its eponymous heroine, including her growth to adulthood and her love for Mr. Rochester, the brooding master of Thornfield Hall. The novel revolutionised prose fiction in that the focus on Jane's moral and spiritual development is told through an intimate, first-person narrative, where actions and events are coloured by a psychological intensity. The book contains elements of social criticism, with a strong sense of Christian morality at its core and is considered by many to be ahead of its time because of Jane's individualistic character and how the novel approaches the topics of class, sexuality, religion and feminism.";2db38772-235e-432c-92a0-ce09ca340728;11;12.34;GBP;10;2019-09-20 10:10:10.000
fd0c5fda-8811-4e20-bcff-3a776abc290a;The Raven;"“The Raven"" is a narrative poem by American writer Edgar Allan Poe. First published in January 1845, the poem is often noted for its musicality, stylized language, and supernatural atmosphere. It tells of a talking raven's mysterious visit to a distraught lover, tracing the man's slow fall into madness. The lover, often identified as being a student, is lamenting the loss of his love, Lenore. Sitting on a bust of Pallas, the raven seems to further distress the protagonist with its constant repetition of the word ""Nevermore"". The poem makes use of folk, mythological, religious, and classical references.";286ae4b1-b845-4af8-9827-4eb04fe5f380;333;13.13;USD;1;2019-09-20 10:10:10.000
b7bca6dd-0497-465e-9a5a-56f244174c8c;Eleonora;"""Eleonora"" is a short story by Edgar Allan Poe, first published in 1842 in Philadelphia in the literary annual The Gift. It is often regarded as somewhat autobiographical and has a relatively ""happy"" ending.";286ae4b1-b845-4af8-9827-4eb04fe5f380;555;14.14;USD;5;2019-09-20 10:10:10.000
5e69a718-d86b-4461-8953-0edadcd87960;Catweazle;Catweazle is a British fantasy television series, starring Geoffrey Bayldon in the title role, and created by Richard Carpenter for London Weekend Television. The first series, produced and directed by Quentin Lawrence, was screened in the UK on ITV in 1970. The second series, directed by David Reid and David Lane, was shown in 1971. Each series had thirteen episodes, most but not all written by Carpenter, who also published two books based on the scripts.;cbfec09e-0ff4-4cfc-adf1-0a37500da750;22;15.15;EUR;3;2019-09-20 10:10:10.000
ID;locale;title;descr
abed2f7a-c50e-4bc5-89fd-9a00a54b4b16;de;Sturmhöhe;Sturmhöhe (Originaltitel: Wuthering Heights) ist der einzige Roman der englischen Schriftstellerin Emily Brontë (1818–1848). Der 1847 unter dem Pseudonym Ellis Bell veröffentlichte Roman wurde vom viktorianischen Publikum weitgehend abgelehnt, heute gilt er als ein Klassiker der britischen Romanliteratur des 19. Jahrhunderts.
abed2f7a-c50e-4bc5-89fd-9a00a54b4b16;es;Cumbres Borrascosas;Cumbres Borrascosas (Título original: Wuthering Heights) es la única novela de Emily Brontë (1818–1848). Fue publicada por primera vez en 1847 bajo el seudónimo de Ellis Bell. Aunque ahora se considera un clásico de la literatura inglesa, el recibimiento inicial de Cumbres Borrascosas fue tibio en el mejor de los casos.
6869961b-c533-42b7-9d60-30fae4f46ab6;de;Jane Eyre;Jane Eyre. Eine Autobiographie (Originaltitel: Jane Eyre. An Autobiography), erstmals erschienen im Jahr 1847 unter dem Pseudonym Currer Bell, ist der erste veröffentlichte Roman der britischen Autorin Charlotte Brontë und ein Klassiker der viktorianischen Romanliteratur des 19. Jahrhunderts. Der Roman erzählt in Form einer Ich-Erzählung die Lebensgeschichte von Jane Eyre (ausgesprochen /ˌdʒeɪn ˈɛə/), die nach einer schweren Kindheit eine Stelle als Gouvernante annimmt und sich in ihren Arbeitgeber verliebt, jedoch immer wieder um ihre Freiheit und Selbstbestimmung kämpfen muss. Als klein, dünn, blass, stets schlicht dunkel gekleidet und mit strengem Mittelscheitel beschrieben, gilt die Heldin des Romans Jane Eyre nicht zuletzt aufgrund der Kino- und Fernsehversionen der melodramatischen Romanvorlage als die bekannteste englische Gouvernante der Literaturgeschichte
6869961b-c533-42b7-9d60-30fae4f46ab6;es;Jane Eyre;Jane Eyre. Una autobiografía (Título original: Jane Eyre. An Autobiography), se publicó por primera vez en 1847 bajo el pseudónimo de Currer Bell. Es la primera novela publicada por la escritora británica Charlotte Brontë y es considerada un clásico de la literatura inglesa. La novela es narrada por Jane Eyre, contada en primera persona, y cuenta su histora de vida. Luego de una infancia dificil, a los 18 años comienza a trabajar como institutriz en Thornfield Hall y se enamora de su empleador. Durante su vida, Jane lucha por su libertad e independencia. Pequeña, delgada, pálida y vestida siempre de negro, la heroína Jane Eyre se transformó, gracias al cine y televisión, en uno de los personajes mas famosos de la literatura.
b7bca6dd-0497-465e-9a5a-56f244174c8c;de;Eleonora;“Eleonora” ist eine Erzählung von Edgar Allan Poe. Sie wurde 1842 erstveröffentlicht.
b7bca6dd-0497-465e-9a5a-56f244174c8c;es;Eleonora;“Eleonora” es un cuento de Edgar Allan Poe. Se publicó por primera vez en 1842. Es considerado por algunos como un cuento autobiográfico y tiene un final relativamente feliz.
namespace sap.capire.bookstore;
//using { Currency, cuid, managed } from '@sap/cds/common';
//using { sap.capire.products.Products } from '@sap/capire-products';
using { Currency, cuid, managed, sap.common.CodeList } from '@sap/cds/common';
entity Products : cuid, managed {
title : localized String(111);
descr : localized String(1111);
stock : Integer;
price : Decimal(9,2);
currency : Currency;
category : Association to Categories;
}
entity Categories : CodeList {
key ID : Integer;
parent : Association to Categories;
children : Composition of many Categories on children.parent = $self;
}
entity Authors : cuid {
firstname : String(111);
lastname : String(111);
books : Association to many Books on books.author = $self;
}
entity Books : cuid, managed {
title : localized String(111);
descr : localized String(1111);
stock : Integer;
price : Decimal(9,2);
currency : Currency;
category : Association to Categories;
author : Association to Authors;
}
@Capabilities.Updatable: false
entity Orders : cuid, managed {
items : Composition of many OrderItems on items.parent = $self;
total : Decimal(9,2) @readonly;
currency : Currency;
}
@Capabilities.Updatable: false
entity OrderItems : cuid {
parent : Association to Orders not null;
book_ID : UUID;
amount : Integer;
netAmount : Decimal(9,2) @readonly;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "bookstore-cds",
"version": "1.0.0",
"description": "Generated by cds-services-archetype",
"license": "ISC",
"repository": "<Add your repository here>",
"dependencies": {
"bookstore-cds": "file:"
},
"devDependencies": {
"@sap/cds-dk": "^8",
"@sap/ux-specification": "^1.124.5"
}
}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>customer</groupId>
<artifactId>bookstore-parent</artifactId>
<version>${revision}</version>
<packaging>pom</packaging>
<name>bookstore parent</name>
<properties>
<!-- OUR VERSION -->
<revision>1.0.0-SNAPSHOT</revision>
<!-- DEPENDENCIES VERSION -->
<jdk.version>21</jdk.version>
<cds.services.version>3.4.0</cds.services.version>
<spring.boot.version>3.3.5</spring.boot.version>
<cds.install-cdsdk.version>8.4.0-2024101010155372-SNAPSHOT</cds.install-cdsdk.version>
<cds.install-node.downloadUrl>https://nodejs.org/dist/</cds.install-node.downloadUrl>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modules>
<module>srv</module>
</modules>
<dependencyManagement>
<dependencies>
<!-- CDS SERVICES -->
<dependency>
<groupId>com.sap.cds</groupId>
<artifactId>cds-services-bom</artifactId>
<version>${cds.services.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- SPRING BOOT -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<!-- JAVA VERSION -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<release>${jdk.version}</release>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<!-- MAKE SPRING BOOT PLUGIN RUNNABLE FROM ROOT -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<!-- SUREFIRE VERSION -->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.1</version>
</plugin>
<!-- POM FLATTENING FOR CI FRIENDLY VERSIONS -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>1.6.0</version>
<configuration>
<updatePomFile>true</updatePomFile>
<flattenMode>resolveCiFriendliesOnly</flattenMode>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- PROJECT STRUCTURE CHECKS -->
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>Project Structure Checks</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.6.3</version>
</requireMavenVersion>
<requireJavaVersion>
<version>${jdk.version}</version>
</requireJavaVersion>
<reactorModuleConvergence />
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>bookstore-parent</artifactId>
<groupId>customer</groupId>
<version>${revision}</version>
</parent>
<artifactId>bookstore</artifactId>
<packaging>jar</packaging>
<name>bookstore</name>
<!-- ACTUAL DEPENDENCIES -->
<dependencies>
<!-- CDS SPRING BOOT STARTER -->
<dependency>
<groupId>com.sap.cds</groupId>
<artifactId>cds-starter-spring-boot</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sap.cds</groupId>
<artifactId>cds-adapter-odata-v4</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<!-- SPRING BOOT PLUGIN -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<configuration>
<skip>false</skip>
</configuration>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<classifier>exec</classifier>
</configuration>
</execution>
</executions>
</plugin>
<!-- STEPS TO BUILD CDS MODEL AND GENERATE POJOs -->
<plugin>
<groupId>com.sap.cds</groupId>
<artifactId>cds-maven-plugin</artifactId>
<version>${cds.services.version}</version>
<executions>
<execution>
<id>cds.clean</id>
<goals>
<goal>clean</goal>
</goals>
</execution>
<execution>
<id>cds.install-node</id>
<goals>
<goal>install-node</goal>
</goals>
</execution>
<execution>
<id>cds.install-cdsdk</id>
<goals>
<goal>install-cdsdk</goal>
</goals>
</execution>
<execution>
<id>cds.resolve</id>
<goals>
<goal>resolve</goal>
</goals>
</execution>
<execution>
<id>cds.build</id>
<goals>
<goal>cds</goal>
</goals>
<configuration>
<commands>
<command>build --for java</command>
<command>deploy --to h2 --dry --out "${project.basedir}/src/main/resources/schema-h2.sql"</command>
</commands>
</configuration>
</execution>
<execution>
<id>cds.generate</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<basePackage>cds.gen</basePackage>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<!-- A profile that uses global installation of @sap/cds-dk -->
<profile>
<id>cdsdk-global</id>
<activation>
<property>
<name>env.CDSDK_GLOBAL</name>
<value>true</value>
</property>
</activation>
<properties>
<cds.install-node.skip>true</cds.install-node.skip>
<cds.install-cdsdk.skip>true</cds.install-cdsdk.skip>
</properties>
</profile>
</profiles>
</project>
\ No newline at end of file
using { sap.capire.bookstore as db } from '../db/schema';
service AdminService {
entity Products as projection on db.Products;
entity Categories as projection on db.Categories;
entity Authors as projection on db.Authors;
}
// Define Books Service
service BooksService {
@readonly entity Books as projection on db.Books { *, category as genre } excluding { category, createdBy, createdAt, modifiedBy, modifiedAt };
@readonly entity Authors as projection on db.Authors;
}
// Define Orders Service
service OrdersService {
entity Orders as projection on db.Orders;
entity OrderItems as projection on db.OrderItems;
}
package customer.bookstore;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
---
spring:
config.activate.on-profile: default
sql.init.schema-locations: classpath:schema-h2.sql
cds:
data-source.auto-config.enabled: false
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment