Search Results

Search found 3684 results on 148 pages for 'sequence logo'.

Page 2/148 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Hibernate sequence should only generate when ID is <=0

    - by Tim Leys
    Hi all, I'm using the folowing sequence in my code. (I got the sequence and @Id @SequenceGenerator(name = "S912_PRO_SEQ", sequenceName = "S912_PRO_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "S912_PRO_SEQ") @Column(name = "PRO_ID", unique = true, nullable = false, precision = 9, scale = 0) public int getId() { return this.id; } And using the following sequence / triggers in my DB. CREATE SEQUENCE S912_PRO_SEQ nomaxvalue minvalue 20; CREATE OR REPLACE TRIGGER S912_PRO_B_I_TRG BEFORE INSERT ON S912_project REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW ENABLE begin IF :NEW.pro_ID IS NULL THEN select S912_PRO_SEQ.nextval into :new.pro_ID from dual; END IF; end; I was wondering if there is a way to let hibernate generate a sequence ONLY if the ID is <=0 (not set) or if the ID already exists. I know for most cases my trigger would fix the situation. But I do not want to rely completely on it. I hope someone can help me out :p

    Read the article

  • Specifying distinct sequence per table in Hibernate on subclasses

    - by gutch
    Is there a way to specify distinct sequences for each table in Hibernate, if the ID is defined on a mapped superclass? All entities in our application extend a superclass called DataObject like this: @MappedSuperclass public abstract class DataObject implements Serializable { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE) @Column(name = "id") private int id; } @Entity @Table(name = "entity_a") public class EntityA extends DataObject { ... } @Entity @Table(name = "entity_b") public class EntityB extends DataObject { ... } This causes all entities to use a shared sequence, the default hibernate_sequence. What I would like to do is use a separate sequence for each entity, for example entity_a_sequence and entity_b_sequence in the example above. If the ID were specified on the subclasses then I could use the @SequenceGenerator annotation to specify a sequence for each entity, but in this case the ID is on the superclass. Given that ID is in the superclass, is there a way I can use a separate sequence for each entity — and if so, how? (We are using PostgreSQL 8.3, in case that's relevant)

    Read the article

  • create a random sequence, skip to any part of the sequence

    - by Michael Xu
    Hi everyone, In Linux. There is an srand() function, where you supply a seed and it will guarantee the same sequence of pseudorandom numbers in subsequent calls to the random() function afterwards. Lets say, I want to store this pseudo random sequence by remembering this seed value. Furthermore, let's say I want the 100 thousandth number in this pseudo random sequence later. One way, would be to supply the seed number using srand(), and then calling random() 100 thousand times, and remembering this number. Is there a better way of skipping all 99,999 other numbers in the pseudo random list and directly getting the 100 thousandth number in the list. thanks, m

    Read the article

  • oracle sequence init

    - by gospodin
    I wanted to export 3 tables from db1 into db2. Before the export starts, I will create the sequences for those 3 tables. CREATE SEQUENCE TEST_SEQ START WITH 1 INCREMENT BY 1; After the export, I will reinitialize sequnce values to match the max(id) + 1 from the table. CREATE OR REPLACE PROCEDURE "TEST_SEQUENCE" AUTHID CURRENT_USER is v_num number; begin select max(ID) into v_num from TABLE_1; EXECUTE IMMEDIATE 'ALTER SEQUENCE TEST_SEQ INCREMENT BY ' || v_num; EXECUTE IMMEDIATE 'ALTER SEQUENCE 1TEST_SEQ INCREMENT BY 1'; end; / show errors; execute TEST_SEQ; This procedure compiles and executes without problems. But when I want to check t he last value of the sequence, like select TEST_SEQ.nextval from dual; I still get the "1". Can someone tell me why my procedure did not impact my sequence? ps. I am using oracle sql developper to pass sql. Thanks

    Read the article

  • Which Oracle table uses a sequence?

    - by Jaú
    Having a sequence, I need to find out which table.column gets its values. As far as I know, Oracle doesn't keep track of this relationship. So, looking up for the sequence in source code would be the only way. Is that right? Anyone knows of some way to find out this sequence-table relationship?

    Read the article

  • Mapping over sequence with a constant

    - by Hendekagon
    If I need to provide a constant value to a function which I am mapping to the items of a sequence, is there a better way than what I'm doing at present: (map my-function my-sequence (cycle [my-constant-value])) where my-constant-value is a constant in the sense that it's going to be the same for the mappings over my-sequence, although it may be itself a result of some function further out. I get the feeling that later I'll look at what I'm asking here and think it's a silly question because if I structured my code differently it wouldn't be a problem, but well there it is!

    Read the article

  • xor of sequence of numbers

    - by ArG0NaUt
    You are given with a sequence of natural numbers, you can add any natural number to any number in the sequence such that their xor becomes zero. Your goal is to minimize the sum of added numbers. e.g. Consider the following examples : sequence : 1, 3 answer : 2, adding 2 to 1 we get 3^3=0. sequence : 10, 4, 5, 1 answer: 6, adding 3 to 10 & 3 to 8 we get 13^4^8^1 = 0. sequence : 4, 4 answer : 0, since 4^4 = 0. I tried working on binary representations of sequence number but it got so complex. I want to know if there is any simple and efficient way to solve this problem.

    Read the article

  • Oracle sequence but then in MS SQL Server

    - by Raymond
    In Oracle there is a mechanism to generate sequence numbers e.g.; CREATE SEQUENCE supplier_seq MINVALUE 1 MAXVALUE 999999999999999999999999999 START WITH 1 INCREMENT BY 1 CACHE 20; And then execute the statement supplier_seq.nextval to retrieve the next sequence number. How would you create the same functionality in MS SQL Server ? Edit: I'm not looking for ways to automaticly generate keys for table records. I need to generate a unique value that I can use as an (logical) ID for a process. So I need the exact functionality that Oracle provides.

    Read the article

  • SQL SERVER – 2011 – SEQUENCE is not IDENTITY

    - by pinaldave
    Yesterday I posted blog post on the subject SQL SERVER – 2011 – Introduction to SEQUENCE – Simple Example of SEQUENCE and I received comment where user was not clear about difference between SEQUENCE and IDENTITY. The reality is that SEQUENCE not like IDENTITY. There is very clear difference between them. Identity is about single column. Sequence is always incrementing and it is not dependent on any table. Here is the quick example of the same. USE AdventureWorks2008R2 GO CREATE SEQUENCE [Seq] AS [int] START WITH 1 INCREMENT BY 1 MAXVALUE 20000 GO -- Run five times SELECT NEXT VALUE FOR Seq AS SeqNumber; SELECT NEXT VALUE FOR Seq AS SeqNumber; SELECT NEXT VALUE FOR Seq AS SeqNumber; SELECT NEXT VALUE FOR Seq AS SeqNumber; SELECT NEXT VALUE FOR Seq AS SeqNumber; GO -- Clean Up DROP SEQUENCE [Seq] GO Here is the resultset. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, PostADay, SQL, SQL Authority, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • How To Hide YouTube Logo In Video Embeds

    - by Gopinath
    YouTube is the most popular video sharing site where you find videos shared by common users to big organizations sharing their training materials, demos and live casts. Lets an assume an organization wants to upload training/product demo videos to YouTube and embed them on their corporate website.  Would not it be nice if they can hide the YouTube logo from the embedded videos? Definitely Yes. To remove the YouTube logo you need to do a small change to the embed script before using it on your site. Add the flag modestbranding=1 as shown in the script below Here is a YouTube video embedded in this post without the logo. The catch is when logo is hidden the player shows text YouTube as a text overlay at top right corner when you hover the mouse. Hope Google will let us hide even that in the near future. This article titled,How To Hide YouTube Logo In Video Embeds, was originally published at Tech Dreams. Grab our rss feed or fan us on Facebook to get updates from us.

    Read the article

  • Considerations Before Hiring Logo Design Services

    These days, hiring a logo design service is not easy. Just enter a keyword "logo design" in a search engine and you will see thousands of result pages full of online logo design services. Certainly, ... [Author: Gisselle Gloria - Web Design and Development - October 05, 2009]

    Read the article

  • Visual Studio UML Sequence Diagram

    - by ikurtz
    I was wondering if there was a Sequence Diagram generator for C#? Im using Visual Studio 2008 Professional. If not is there a quick and simple software? Im finding Enterprise Architect and Visio a bit to cryptic for a beginner. I have found the Class Diagram feature on Visual Studio, which s very useful and am hoping for a equally useful simple program to generate Sequence Diagrams. Thanks.

    Read the article

  • Undefined Behavior and Sequence Points Reloaded

    - by Nawaz
    Consider this topic a sequel of the following topic: Previous Installment Undefined Behavior and Sequence Points Let's revisit this funny and convoluted expression (the italicized phrases are taken from the above topic *smile* ): i += ++i; We say this invokes undefined-behavior. I presume that when say this, we implicitly assume that type of i is one of built-in types. So my question is: what if the type of i is a user-defined type? Say it's type is Index which is defined later in this post (see below). Would it still invoke undefined-behavior? If yes, why? Is it not equivalent to writing i.operator+=(i.operator ++()); or even syntactically simpler i.add(i.inc());? Or, do they too invoke undefined-behavior? If no, why not? After all, the object i gets modified twice between consecutive sequence points. Please recall the rule of thumb : an expression can modify an object's value only once between consecutive "sequence points. And if i += ++i is an expression, then it must invoke undefined-behavior. If so, then it's equivalents i.operator+=(i.operator ++()); and i.add(i.inc()); must also invoke undefined-behavior which seems to be untrue! (as far as I understand) Or, i += ++i is not an expression to begin with? If so, then what is it and what is the definition of expression? If it's an expression, and at the same time, it's behavior is also well-defined, then it implies that number of sequence points associated with an expression somehow depends on the type of operands involved in the expression. Am I correct (even partly)? By the way, how about this expression? a[++i] = i; //taken from the previous topic. but here type of `i` is Index. class Index { int state; public: Index(int s) : state(s) {} Index& operator++() { state++; return *this; } Index& operator+=(const Index & index) { state+= index.state; return *this; } operator int() { return state; } Index & add(const Index & index) { state += index.state; return *this; } Index & inc() { state++; return *this; } };

    Read the article

  • Firebird sequence-backed ID shorthand

    - by pilcrow
    What do others do to simplify the creation of simple, serial surrogate keys populated by a SEQUENCE (a.k.a. GENERATOR) in Firebird = 2.1? I finc the process comparatively arduous: For example, in PostgreSQL, I simply type: pg> CREATE TABLE tbl ( > id SERIAL NOT NULL PRIMARY KEY, > ... In MySQL, I simply type: my> CREATE TABLE tbl ( > id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, > ... But in Firebird I type: fb> CREATE TABLE tbl ( > id BIGINT NOT NULL PRIMARY KEY, > ... fb> CREATE SEQUENCE tbl_id_seq; fb> SET TERM !!; > CREATE TRIGGER tbl_id_trg FOR tbl > ACTIVE BEFORE INSERT POSITION 0 > AS > BEGIN > IF ((new.id IS NULL) OR (new.id <= 0)) THEN > BEGIN > new.id = GEN_ID(tbl_id_seq, 1); > END > END !! > SET TERM ; !! ... and I get pretty bored by the time I reach trigger definition. However, I routinely make SEQUENCE-backed ID fields for temporary, developement and throw-away tables. What do others do to simplify this? Work with an IDE? Run a pre-processing, in-house perl script over the DDL file? Etc.

    Read the article

  • Find min. "join" operations for sequence

    - by utyle
    Let's say, we have a list/an array of positive integers x1, x2, ... , xn. We can do a join operation on this sequence, that means that we can replace two elements that are next to each other with one element, which is sum of these elements. For example: - array/list: [1;2;3;4;5;6] we can join 2 and 3, and replace them with 5; we can join 5 and 6, and replace them with 11; we cannot join 2 and 4; we cannot join 1 and 3 etc. Main problem is to find minimum join operations for given sequence, after which this sequence will be sorted in increasing order. Note: empty and one-element sequences are sorted in increasing order. Basic examples: for [4; 6; 5; 3; 9] solution is 1 (we join 5 and 3) for [1; 3; 6; 5] solution is also 1 (we join 6 and 5) What I am looking for, is an algorithm that solve this problem. It could be in pseudocode, C, C++, PHP, OCaml or similar (I mean: I woluld understand solution, if You wrote solution in one of these languages). I would appreciate Your help.

    Read the article

  • CommunicationException with 'not recognized sequence' message in WCF.

    - by brain_pusher
    Hello, I get a CommunicationException while using WCF service. The message is: The remote endpoint no longer recognizes this sequence. This is most likely due to an abort on the remote endpoint. The value of wsrm:Identifier is not a known Sequence identifier. The reliable session was faulted. The exception is thrown in a moment after a contract method was called. Before calling contract method the channel state is Opened. I restore my service client after catching this exception and for some time it works fine. But then this error occures again. It seems like some timeout is exceeded, but I can't understand which one exactly. I use wsHttpBinding with reliableSession enabled. The InactivityTimeout is set to half an hour and I'm sure it's not exceeded, because exception is thrown earlier.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >