써먹는 웹개발
[BAS] CAP Java(CDS) 프로젝트 기본 셋팅 본문
728x90
반응형
BAS는 Visual Studio Code의 Web 버전입니다.
1. New Project From Template에서 CAP Project 선택 후 Start 버튼 클릭
2. CAP Project Details에서 다음과 같이 입력 및 체크하고 Finish 버튼 클릭합니다.
1) 프로젝트명 입력
2) Select your runtime에 Java 선택
3) SAP HANA Cloud와 Cloud Foundry: MTA Deployment 체크
3. 소스 작성
3-1. db/schema.cds
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
namespace org.starj.cds.demo;
using { Currency, managed, sap } from '@sap/cds/common';
type GeoPoint : String;
type Timezone : String;
type CountryCode : String(2);
type LanguageCode : String(2);
entity Countries {
official_language : LanguageCode;
key country_code : String(2);
iso3_code : String(3);
onu_code : Integer;
name_en : String;
name_fr : String;
name_sp : String;
geo_point : GeoPoint;
}
entity Populations {
key id : Integer;
name : String;
ascii_name : String;
alternate_name : String;
feature_class : String(1);
feature_code : String;
country_code : CountryCode;
country : Association to Countries on country_code = country.country_code;
population : Integer;
elevation : Integer;
timezone : Timezone;
geo_point : GeoPoint;
}
|
cs |
1
2
3
4
5
6
7
8
9
10
|
namespace org.starj.cds.demo;
using { org.starj.cds.demo as model } from '../db/schema';
service MainService @(path:'/main') {
entity Countries as projection on model.Countries excluding { onu_code, geo_point };
entity Populations as projection on model.Populations;
action adjustPopulation(population_id: model.Populations:id, population: Integer);
};
|
cs |
728x90
반응형
'SAP' 카테고리의 다른 글
[SAP] SAP HANA Cloud 추가 (0) | 2024.07.08 |
---|---|
[SAP] SAP Business Application Studio 권한 추가 (0) | 2024.07.03 |
[SAP] btp 명령어 실행되도록 셋팅방법 (0) | 2024.07.02 |
Comments